# shlex - pydoc - phpman

Help on module shlex:

## NAME
    shlex - A lexical analyzer class for simple shell-like syntaxes.

## MODULE REFERENCE
    <https://docs.python.org/3.10/library/shlex.html>

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

## CLASSES
    builtins.object
        shlex

### class shlex
     |  shlex(instream=None, infile=None, posix=False, punctuation_chars=False)
     |
     |  A lexical analyzer class for simple shell-like syntaxes.
     |
     |  Methods defined here:
     |
     |  __init__(self, instream=None, infile=None, posix=False, punctuation_chars=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self)
     |
     |  __next__(self)
     |
     |  error_leader(self, infile=None, lineno=None)
     |      Emit a C-compiler-like, Emacs-friendly error-message leader.
     |
     |  get_token(self)
     |      Get a token from the input stream (or from stack if it's nonempty)
     |
     |  pop_source(self)
     |      Pop the input source stack.
     |
     |  push_source(self, newstream, newfile=None)
     |      Push an input source onto the lexer's input source stack.
     |
     |  push_token(self, tok)
     |      Push a token onto the stack popped by the get_token method
     |
     |  read_token(self)
     |
     |  sourcehook(self, newfile)
     |      Hook called on a filename to be sourced.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  punctuation_chars
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables (if defined)
     |
     |  __weakref__
     |      list of weak references to the object (if defined)

## FUNCTIONS
### join
        Return a shell-escaped string from *split_command*.

### quote
        Return a shell-escaped version of the string *s*.

### split
        Split the string *s* using shell-like syntax.

## DATA
    __all__ = ['shlex', 'split', 'quote', 'join']

## FILE
    /usr/lib/python3.10/shlex.py


