| |
| Returns a tuple ``(buildno, builddate)`` stating the Python build number and |
| date as strings. |
| |
| |
| .. function:: python_compiler() |
| |
| Returns a string identifying the compiler used for compiling Python. |
n | |
| |
| .. function:: python_branch() |
| |
| Returns a string identifying the Python implementation SCM branch. |
| |
| .. versionadded:: 2.6 |
| |
| |
| .. function:: python_implementation() |
| |
| Returns a string identifying the Python implementation. Possible return values |
| are: 'CPython', 'IronPython', 'Jython' |
| |
| .. versionadded:: 2.6 |
| |
| |
| .. function:: python_revision() |
| |
| Returns a string identifying the Python implementation SCM revision. |
| |
| .. versionadded:: 2.6 |
| |
| |
| .. function:: python_version() |
| |
| Returns the Python version as string ``'major.minor.patchlevel'`` |
| |
| Note that unlike the Python ``sys.version``, the returned value will always |
| include the patchlevel (it defaults to 0). |
| As a hint: *ptype* is ``'Uniprocessor Free'`` on single processor NT machines |
| and ``'Multiprocessor Free'`` on multi processor machines. The *'Free'* refers |
| to the OS version being free of debugging code. It could also state *'Checked'* |
| which means the OS version uses debugging code, i.e. code that checks arguments, |
| ranges, etc. |
| |
| .. note:: |
| |
n | This function only works if Mark Hammond's :mod:`win32all` package is installed |
n | Note: this function works best with Mark Hammond's |
| :mod:`win32all` package installed, but also on Python 2.3 and |
| later (support for this was added in Python 2.6). It obviously |
| and (obviously) only runs on Win32 compatible platforms. |
| only runs on Win32 compatible platforms. |
| |
| |
| Win95/98 specific |
| ^^^^^^^^^^^^^^^^^ |
n | |
| |
| .. function:: popen(cmd, mode='r', bufsize=None) |
| |
| Portable :func:`popen` interface. Find a working popen implementation |
| preferring :func:`win32pipe.popen`. On Windows NT, :func:`win32pipe.popen` |
| should work; on Windows 9x it hangs due to bugs in the MS C library. |
| |
n | .. % This KnowledgeBase article appears to be missing... |
| .. % See also \ulink{MS KnowledgeBase article Q150956}{}. |
| |
| |
| Mac OS Platform |
| --------------- |
| |
| |
| .. function:: mac_ver(release='', versioninfo=('','',''), machine='') |
| |
| Get Mac OS version information and return it as tuple ``(release, versioninfo, |
| machine)`` with *versioninfo* being a tuple ``(version, dev_stage, |
| non_release_version)``. |
| |
| Entries which cannot be determined are set to ``''``. All tuple entries are |
| strings. |
| |
| Documentation for the underlying :cfunc:`gestalt` API is available online at |
n | `<http://www.rgaros.nl/gestalt/>`_. |
n | http://www.rgaros.nl/gestalt/. |
| |
| |
| Unix Platforms |
| -------------- |
| |
| |
n | .. function:: dist(distname='', version='', id='', supported_dists=('SuSE','debian','redhat','mandrake')) |
n | .. function:: dist(distname='', version='', id='', supported_dists=('SuSE','debian','redhat','mandrake',...)) |
| |
n | This is another name for :func:`linux_distribution`. |
| |
| .. function:: linux_distribution(distname='', version='', id='', supported_dists=('SuSE','debian','redhat','mandrake',...), full_distribution_name=1) |
| |
| Tries to determine the name of the OS distribution name Returns a tuple |
| Tries to determine the name of the Linux OS distribution name. |
| |
| ``supported_dists`` may be given to define the set of Linux distributions to |
| look for. It defaults to a list of currently supported Linux distributions |
| identified by their release file name. |
| |
| If ``full_distribution_name`` is true (default), the full distribution read |
| from the OS is returned. Otherwise the short name taken from |
| ``supported_dists`` is used. |
| |
| ``(distname, version, id)`` which defaults to the args given as parameters. |
| Returns a tuple ``(distname,version,id)`` which defaults to the args given as |
| |
| parameters. ``id`` is the item in parentheses after the version number. It |
| is usually the version codename. |
| |
| .. function:: libc_ver(executable=sys.executable, lib='', version='', chunksize=2048) |
| |
| Tries to determine the libc version against which the file executable (defaults |
| to the Python interpreter) is linked. Returns a tuple of strings ``(lib, |
| version)`` which default to the given parameters in case the lookup fails. |
| |
| Note that this function has intimate knowledge of how different libc versions |
t | add symbols to the executable is probably only useable for executables compiled |
t | add symbols to the executable is probably only usable for executables compiled |
| using :program:`gcc`. |
| |
| The file is read and scanned in chunks of *chunksize* bytes. |
| |