skip to navigation
skip to content

Python Wiki

Python Insider Blog

Python 2 or 3?

Help Fund Python

[Python resources in languages other than English]

Non-English Resources

Add an event to this calendar.

Times are shown in UTC/GMT.

Add an event to this calendar.

PEP: 271
Title: Prefixing sys.path by command line option
Version: 1260bc408958
Last-Modified:  2006-03-02 19:54:50 +0000 (Thu, 02 Mar 2006)
Author: Frédéric B. Giacometti <fred at>
Status: Rejected
Type: Standards Track
Created: 15-Aug-2001
Python-Version: 2.2


    At present, setting the PYTHONPATH environment variable is the
    only method for defining additional Python module search

    This PEP introduces the '-P' valued option to the python command
    as an alternative to PYTHONPATH.


    On Unix:

        python -P $SOMEVALUE

    will be equivalent to

        env PYTHONPATH=$SOMEVALUE python

    On Windows 2K:

        python -P %SOMEVALUE%

    will (almost) be equivalent to

            && python && set PYTHONPATH=%__PYTHONPATH%

Other Information

    This option is equivalent to the 'java -classpath' option.

When to use this option

    This option is intended to ease and make more robust the use of
    Python in test or build scripts, for instance.

Reference Implementation

    A patch implementing this is available from SourceForge:
    with the patch discussion at:


    This document has been placed in the public domain.