2001-09-13 12:46:44 -04:00
|
|
|
PEP: 271
|
|
|
|
Title: Prefixing sys.path by command line option
|
2022-10-05 12:48:43 -04:00
|
|
|
Author: Frédéric B. Giacometti <fred@arakne.com>
|
2001-09-26 01:01:24 -04:00
|
|
|
Status: Rejected
|
2001-09-13 12:46:44 -04:00
|
|
|
Type: Standards Track
|
2017-01-07 13:33:00 -05:00
|
|
|
Content-Type: text/x-rst
|
2001-09-13 12:46:44 -04:00
|
|
|
Created: 15-Aug-2001
|
|
|
|
Python-Version: 2.2
|
|
|
|
Post-History:
|
|
|
|
|
|
|
|
|
|
|
|
Abstract
|
2017-01-07 13:33:00 -05:00
|
|
|
========
|
2001-09-13 12:46:44 -04:00
|
|
|
|
2017-01-07 13:33:00 -05:00
|
|
|
At present, setting the ``PYTHONPATH`` environment variable is the
|
|
|
|
only method for defining additional Python module search
|
|
|
|
directories.
|
2001-09-13 12:46:44 -04:00
|
|
|
|
2017-01-07 13:33:00 -05:00
|
|
|
This PEP introduces the '-P' valued option to the python command
|
|
|
|
as an alternative to ``PYTHONPATH``.
|
2001-09-13 12:46:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
Rationale
|
2017-01-07 13:33:00 -05:00
|
|
|
=========
|
2001-09-13 12:46:44 -04:00
|
|
|
|
2017-01-07 13:33:00 -05:00
|
|
|
On Unix::
|
2001-09-13 12:46:44 -04:00
|
|
|
|
2017-01-07 13:33:00 -05:00
|
|
|
python -P $SOMEVALUE
|
2001-09-13 12:46:44 -04:00
|
|
|
|
2017-01-07 13:33:00 -05:00
|
|
|
will be equivalent to::
|
2001-09-13 12:46:44 -04:00
|
|
|
|
2017-01-07 13:33:00 -05:00
|
|
|
env PYTHONPATH=$SOMEVALUE python
|
2001-09-13 12:46:44 -04:00
|
|
|
|
2017-01-07 13:33:00 -05:00
|
|
|
On Windows 2K::
|
2001-09-13 12:46:44 -04:00
|
|
|
|
2017-01-07 13:33:00 -05:00
|
|
|
python -P %SOMEVALUE%
|
2001-09-13 12:46:44 -04:00
|
|
|
|
2017-01-07 13:33:00 -05:00
|
|
|
will (almost) be equivalent to::
|
|
|
|
|
|
|
|
set __PYTHONPATH=%PYTHONPATH% && set PYTHONPATH=%SOMEVALUE%\
|
|
|
|
&& python && set PYTHONPATH=%__PYTHONPATH%
|
2001-09-13 12:46:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
Other Information
|
2017-01-07 13:33:00 -05:00
|
|
|
=================
|
2001-09-13 12:46:44 -04:00
|
|
|
|
2017-01-07 13:33:00 -05:00
|
|
|
This option is equivalent to the 'java -classpath' option.
|
2001-09-13 12:46:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
When to use this option
|
2017-01-07 13:33:00 -05:00
|
|
|
=======================
|
2001-09-13 12:46:44 -04:00
|
|
|
|
2017-01-07 13:33:00 -05:00
|
|
|
This option is intended to ease and make more robust the use of
|
|
|
|
Python in test or build scripts, for instance.
|
2001-09-13 12:46:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
Reference Implementation
|
2017-01-07 13:33:00 -05:00
|
|
|
========================
|
2001-09-13 12:46:44 -04:00
|
|
|
|
2017-01-07 13:33:00 -05:00
|
|
|
A patch implementing this is available from SourceForge::
|
2001-09-13 14:41:35 -04:00
|
|
|
|
|
|
|
http://sourceforge.net/tracker/download.php?group_id=5470&atid=305470&file_id=6916&aid=429614
|
2017-01-07 13:33:00 -05:00
|
|
|
|
|
|
|
with the patch discussion at::
|
2001-09-13 14:41:35 -04:00
|
|
|
|
|
|
|
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=429614&group_id=5470
|
|
|
|
|
2001-09-13 12:46:44 -04:00
|
|
|
|
|
|
|
Copyright
|
2017-01-07 13:33:00 -05:00
|
|
|
=========
|
|
|
|
|
|
|
|
This document has been placed in the public domain.
|