Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

python(1) [osx man page]

PYTHON(1)						    BSD General Commands Manual 						 PYTHON(1)

python, pythonw -- an interpreted, interactive, object-oriented programming language SYNOPSIS
python ... pythonw ... DESCRIPTION
To support multiple versions, the programs named python and pythonw now just select the real version of Python to run, depending on various settings. (As of Python 2.5, python and pythonw are interchangeable; both execute Python in the context of an application bundle, which means they have access to the Graphical User Interface; thus both can, when properly programmed, display windows, dialogs, etc.) The current supported versions are 2.6 and 2.7, with the default being 2.6. Use % man python2.6 % man python2.7 % man pythonw2.6 % man pythonw2.7 to see the man page for a specific version. Without a version specified, % man pydoc and the like, will show the man page for the (unmodified) default version of Python (2.6). To see the man page for a specific version, use, for example, % man pydoc2.7 CHANGING THE DEFAULT PYTHON
Using % defaults write Version 2.7 will make version 2.7 the user default when running the both the python and pythonw commands (versioner is the internal name of the version- selection software used). To set a system-wide default, replace '' with '/Library/Preferences/' (admin privileges will be required). The environment variable VERSIONER_PYTHON_VERSION can also be used to set the python and pythonw version: % export VERSIONER_PYTHON_VERSION=2.7 # Bourne-like shells or % setenv VERSIONER_PYTHON_VERSION 2.7 # C-like shells % python ... This environment variable takes precedence over the preference file settings. 64-BIT SUPPORT Versions 2.6 and 2.7 support 64-bit execution (which is on by default). Like the version of Python, the python command can select between 32 and 64-bit execution (when both are available). Use: % defaults write Prefer-32-Bit -bool yes to make 32-bit execution the user default (using '/Library/Preferences/' will set the system-wide default). The environment variable VERSIONER_PYTHON_PREFER_32_BIT can also be used (has precedence over the preference file): % export VERSIONER_PYTHON_PREFER_32_BIT=yes # Bourne-like shells or % setenv VERSIONER_PYTHON_PREFER_32_BIT yes # C-like shells Again, the preference setting and environmental variable applies to both python and pythonw. USING A SPECIFIC VERSION
Rather than using the python command, one can use a specific version directly. For example, running python2.7 from the command line will run the 2.7 version of Python, independent of what the default version of Python is. One can use a specific version of Python on the #! line of a script, but that may have portability and future compatibility issues. Note that the preference files and environment variable that apply to the python command, do not apply when running a specific version of Python. In particular, running python2.6 will always default to 64-bit execution (unless one uses the arch(1) command to specifically select a 32-bit architecture). SEE ALSO
python2.6(1), python2.7(1), pythonw2.6(1), pythonw2.7(1), arch(1) BSD
Aug 10, 2008 BSD

Check Out this Related Man Page

DH_PYCENTRAL(1) 						     Debhelper							   DH_PYCENTRAL(1)

dh_pycentral - use the python-central framework to handle Python modules and extensions SYNOPSIS
dh_pycentral [debhelper options] [-n] [-Xitem] [-V version] [module dirs ...] DESCRIPTION
dh_pycentral is a debhelper program that will scan your package, detect public Python modules and move them in /usr/share/pycentral so that python-central can byte-compile those for all supported Python versions. Extensions are kept into the original installation location. Moving the files to the pycentral location and adding symbolic links to /usr/lib/pythonX.Y/*-packages can be done by setting the environment varibale DH_PYCENTRAL to a string containing the string include-links. Moving the files to the pycentral location can be disabled by setting the environment varibale DH_PYCENTRAL to a string containing the string nomove. The functionality to shorten the time of unavailabilty of files during unpack and configure has been removed (symlinking files in the preinst and not removing the symlinked files on upgrade) in version 0.6.9. You must have filled the XS-Python-Version header to indicate the set of python versions that are going to be supported. dh_pycentral expects the XB-Python-Version for each binary package it is supposed to work on. dh_pycentral will also generate substitution variables: the ${python:Provides} variable will contain versioned provides of the package (if the package's name starts with "python-"). A python-foo package could provide "python2.3-foo" and "python2.4-foo" at the same time. Python extensions have to provide those whereas it's only option for pure python modules. The ${python:Versions} variable should be used to provide the required XB-Python-Version field listing the python versions supported by the package. OPTIONS
module dirs If your package installs python modules in non-standard directories, you can make dh_pycentral check those directories by passing their names on the command line. By default, it will check /usr/lib/$PACKAGE, /usr/share/$PACKAGE, /usr/lib/games/$PACKAGE, /usr/share/games/$PACKAGE, /usr/lib/python?.?/site-packages and /usr/lib/python?.?/dist-packages. Note: only /usr/lib/python?.?/site-packages and the extra names on the command line are searched for binary (.so) modules. -V version If the .py files your package ships are meant to be used by a specific pythonX.Y version, you can use this option to specify the desired version, such as 2.3. Do not use if you ship modules in /usr/lib/site-python. With the new policy, this option is mostly deprecated. Use the XS-Python-Field to indicate that you're using a specific python version. -n, --noscripts Do not modify postinst/postrm scripts. -Xitem, --exclude=item Exclude files that contain "item" anywhere in their filename from being taken into account to generate the python dependency. You may use this option multiple times to build up a list of things to exclude. CONFORMS TO
Python policy, version 0.4.1 (2006-06-20) SEE ALSO
debhelper(7) This program is a part of python-central but is made to work with debhelper. AUTHORS
Raphael Hertzog <> Also includes bits of the old dh_python written by Josselin Mouette <> who used many ideas from Brendan O'Dea <>. 2011-04-14 DH_PYCENTRAL(1)
Man Page