PYTHONPATH question

Skip Montanaro skip at pobox.com
Sun Apr 13 18:33:12 EDT 2003


    nomad> PYTHONPATH=$PYTHONPATH:<colon-separated list of directories>
    nomad> export PYTHONPATH

    >> What's the interpretation of an empty element in $PYTHONPATH?

    nomad> My thinking was rather that, if there was a system-wide
    nomad> $PYTHONPATH set in /etc/profile, it would be overwriten by any
    nomad> $PYTHONPATH statement in ~/.profile that didn't explicitly
    nomad> include it, and that might bugger up other 3rd party modules.

Sure enough.  (I generally only program on single user systems, so the
/etc/profile thing wouldn't sting me.)  How about:

    PYTHONPATH=$PYTHONPATH${PYTHONPATH:+:}<colon-separated list of dirs>

Skip






More information about the Python-list mailing list