class shlex.shlex(instream=None, infile=None, posix=False)
A shlex
instance or subclass instance is a lexical analyzer object. The initialization argument, if present, specifies where to read characters from. It must be a file-/stream-like object with read()
and readline()
methods, or a string. If no argument is given, input will be taken from sys.stdin
. The second optional argument is a filename string, which sets the initial value of the infile
attribute. If the instream argument is omitted or equal to sys.stdin
, this second argument defaults to “stdin”. The posix argument defines the operational mode: when posix is not true (default), the shlex
instance will operate in compatibility mode. When operating in POSIX mode, shlex
will try to be as close as possible to the POSIX shell parsing rules.
Please login to continue.