sys
System-specific parameters and functions. The list of command line arguments passed to a Python script. sys. argv 0 is the script name. A list of strings giving the names of all modules written in C that are linked into this interpreter. Native byte order, either 'big' -endian or 'little' -endian . How often to check for thread switches or signals measured in number of virtual machine instructions . Deprecated since , use method getcheckinterval instead. A string containing the copyright...
Typical python module header
Since 2.3 the encoding of a Python source file must be declared as one of the two first lines or defaults to 7 bits Ascii PEP-0263 , with the format Std encodings are defined here, e.g. ISO-8859-1 aka latin1 , iso-8859-15 latin9 , UTF-8 Not all encodings supported, in particular UTF-16 is not supported. It's now a syntax error if a module contains string literals with 8-bit characters but doesn't have an encoding declaration was a warning before . Since 2.5, from _future_ import feature...
List of modules and packages in base distribution
Built-ins and content of python Lib directory. The subdirectory Lib site-packages contains platform-specific packages and modules. Main distributions Windows, Unix , some OS specific modules may be missing Provide direct access to all ' built-in' identifiers of Python, e.g._builtin_.open is the full name for the built-in function open . Future statement definitions. Used to progressively introduce new features in the language. Represent the otherwise anonymous scope in which the interpreter's...
shutil
High-level file operations copying, deleting . Copies the contents of file src to file dest, retaining file permissions. Recursively copies an entire directory tree rooted at src into dest which should not already exist . If sym nks is true, links in src are kept as such in dest. 2.6 New gnore callable argument. Will be called with each directory path and a list of the directory's contents, must return a list of names to ignore. shutil.ignore_patterns can be used to exclude glob-style patterns,...
Generators
A generator is a function that retains its state between 2 calls and produces a new value at each invocation. The values are returned one at a time using the keyword yield, while return or raise stopiteration are used to notify the end of values. A typical use is the production of IDs, names, or serial numbers. Fancier applications like nanothreads are also possible. In 2.2, the feature needs to be enabled by the statement from__future__import generators not To use a generator call the...
posixpath
Do not import this module directly, import os instead and refer to this module as os.path. e.g. os.path.exists p Returns absolute path for path, taking current working dir in account. Returns the longuest path prefix taken character-by-character that is a prefix of all paths in list or '' if list empty . directory and name parts of path. See also split. True if path is the path of an existing file or directory. See also lexists. Returns a copy of path with expansion done. Returns string that is...