
On 26 May 2000, Fred L. Drake said:
It's useful to remember that $PYTHONSTARTUP only affects interactive interpreters, not scripts/applications. Using this for anything related to the installed base is pretty bogus. It would also be unreliable since users won't cooperate. ;)
Thanks for the reminder. The latter also applies to PYTHONPATH: if you expect an environment variable to be set, you had bloody well better supply a shell script that sets it appropriately. (And forget about portability to Mac OS or Windows -- or at least, forget about being used on Windows by anybody except Unix refugees.)
I have yet to hear howls of my revulsion at my loopy idea of sticking this: import sys; sys.path.insert(0, application-python-path)
into scripts that are installed as part of a "Python application" (ie. a module distribution whose main interface is a script or scripts, and that gets its own directory rather than dangling off Python's library directory). Could it be that people actually think this is a *good* idea? ;-)
Greg