how do I modify the system path variable in python script?
Question: I'm trying to run a python script from cron, but its not running properly so
I'm assuming its the different path env variable. Is there anyway to change
the variable within a python script?


Answer: @ubuntu has the right approach, but for what it's worth, @Joe Schmoe, if you
ever need the info:

    
    
    import sys
    print sys.path
    ['.', '/usr/local/bin', '/usr/local/lib/python2.6/dist-packages',...]
    sys.path.append('/home/JoeBlow/python_scripts')
    print sys.path
    ['.', '/usr/local/bin', '/usr/local/lib/python2.6/dist-packages', '/home/JoeBlow/python_scripts',...]
       

sys.path is an array containing everything that was in your initiating
script's PYTHONPATH variable (or whatever your shell's default PYTHONPATH is).

