functions. Functions thus registered are automatically executed upon normal
interpreter termination.
+.. seealso::
+
+ Latest version of the `atexit Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/atexit.py?view=markup>`_
+
Note: the functions registered via this module are not called when the program
is killed by a signal, when a Python fatal internal error is detected, or when
:func:`os._exit` is called.
.. versionadded:: 2.1
+.. seealso::
+
+ Latest version of the `bisect module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/bisect.py?view=markup>`_
+
The following functions are provided:
tools, and prototypes that will later be wrapped in a more sophisticated
interface.
+.. seealso::
+
+ Latest version of the `cmd module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/cmd.py?view=markup>`_
.. class:: Cmd([completekey[, stdin[, stdout]]])
statement. For more information see also :ref:`typecontextmanager` and
:ref:`context-managers`.
+.. seealso::
+
+ Latest version of the `contextlib Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/contextlib.py?view=markup>`_
+
Functions provided:
input is defined in the file :file:`Include/opcode.h` and used by the compiler
and the interpreter.
+.. seealso::
+
+ Latest version of the `dis module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/dis.py?view=markup>`_
+
.. impl-detail::
Bytecode is an implementation detail of the CPython interpreter! No
with various optional time/correctness trade-offs. For comparing files,
see also the :mod:`difflib` module.
+.. seealso::
+
+ Latest version of the `filecmp Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/filecmp.py?view=markup>`_
+
The :mod:`filecmp` module defines the following functions:
returns an accordingly opened file-like object. Two useful hooks are already
provided by this module.
+.. seealso::
+
+ Latest version of the `fileinput Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/fileinput.py?view=markup>`_
+
The following function is the primary interface of this module:
a period are not special for this module, and are matched by the ``*`` and ``?``
patterns.
+.. seealso::
+
+ Latest version of the `fnmatch Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/fnmatch.py?view=markup>`_
.. function:: fnmatch(filename, pattern)
or return other functions. In general, any callable object can be treated as a
function for the purposes of this module.
+.. seealso::
+
+ Latest version of the `functools Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/functools.py?view=markup>`_
+
The :mod:`functools` module defines the following functions:
.. function:: cmp_to_key(func)
subshell. (For tilde and shell variable expansion, use
:func:`os.path.expanduser` and :func:`os.path.expandvars`.)
+.. seealso::
+
+ Latest version of the `glob module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/glob.py?view=markup>`_
.. function:: glob(pathname)
This module provides an implementation of the heap queue algorithm, also known
as the priority queue algorithm.
+.. seealso::
+
+ Latest version of the `heapq Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/heapq.py?view=markup>`_
+
Heaps are arrays for which ``heap[k] <= heap[2*k+1]`` and ``heap[k] <=
heap[2*k+2]`` for all *k*, counting elements from zero. For the sake of
comparison, non-existing elements are considered to be infinite. The
keywords are defined to only be active when particular :mod:`__future__`
statements are in effect, these will be included as well.
+
+.. seealso::
+
+ Latest version of the `keyword module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/keyword.py?view=markup>`_
lines are read from a single file. This is used by the :mod:`traceback` module
to retrieve source lines for inclusion in the formatted traceback.
+.. seealso::
+
+ Latest version of the `linecache module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/linecache.py?view=markup>`_
+
The :mod:`linecache` module defines the following functions:
.. versionchanged:: 2.6
Added support for :class:`set` and :class:`frozenset`.
+.. seealso::
+
+ Latest version of the `pprint module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/pprint.py?view=markup>`_
+
The :mod:`pprint` module defines one class:
.. First the implementation class:
:mod:`base64` module is more compact if there are many such characters, as when
sending a graphics file.
+.. seealso::
+
+ Latest version of the `quopri module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/quopri.py?view=markup>`_
.. function:: decode(input, output[,header])
with limits on the size of the resulting strings. This is used in the Python
debugger and may be useful in other contexts as well.
+.. seealso::
+
+ Latest version of the `repr module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/repr.py?view=markup>`_
+
This module provides a class, an instance, and a function:
The :mod:`sched` module defines a class which implements a general purpose event
scheduler:
+.. seealso::
+
+ Latest version of the `sched module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/sched.py?view=markup>`_
.. class:: scheduler(timefunc, delayfunc)
This includes most class instances, recursive data types, and objects containing
lots of shared sub-objects. The keys are ordinary strings.
+.. seealso::
+
+ Latest version of the `shelve module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/shelve.py?view=markup>`_
.. function:: open(filename[, flag='c'[, protocol=None[, writeback=False]]])
copying and removal. For operations on individual files, see also the
:mod:`os` module.
+.. seealso::
+
+ Latest version of the `shutil module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/shutil.py?view=markup>`_
+
.. warning::
Even the higher-level file copying functions (:func:`copy`, :func:`copy2`)
not be correct. On Windows, file owners, ACLs and alternate data streams
are not copied.
+
Directory and files operations
------------------------------
:ref:`string-formatting` section. Also, see the :mod:`re` module for
string functions based on regular expressions.
+.. seealso::
+
+ Latest version of the `string module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/string.py?view=markup>`_
+
String constants
----------------
well, making it useful for implementing "pretty-printers," including colorizers
for on-screen displays.
+.. seealso::
+
+ Latest version of the `tokenize module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/tokenize.py?view=markup>`_
+
The primary entry point is a :term:`generator`:
.. function:: generate_tokens(readline)
list functions executed during a program run. It can be used in another program
or from the command line.
+.. seealso::
+
+ Latest version of the `trace module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/trace.py?view=markup>`_
.. _trace-cli:
.. versionadded:: 2.5
Support for the ``sftp`` and ``sips`` schemes.
+.. seealso::
+
+ Latest version of the `urlparse module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/urlparse.py?view=markup>`_
+
The :mod:`urlparse` module defines the following functions:
This code was contributed by Lance Ellinghouse, and modified by Jack Jansen.
+.. seealso::
+
+ Latest version of the `uu module Python source code
+ <http://svn.python.org/view/python/branches/release27-maint/Lib/uu.py?view=markup>`_
+
The :mod:`uu` module defines the following functions: