[Tutor] Adding to python path

Guillermo Fernandez guillermo.fernandez at epfl.ch
Sat Feb 28 11:34:29 EST 2004

Thanks for the answer, works great! :-)

Isn't there any way off adding that code (sys.path.append('../lib')) only one, 
outside the scripts, for example in an __init__.py file in the scripts directory?



Magnus Lycka wrote:
>>How could the scripts in the scripts/ folder use the modules of the lib/ folder 
>>if they must be called as normal programs?
> import sys
> sys.path.append('../lib')
> ..methinks. Another option is to place the lib code in the
> standard site-packages directory.
>>Structure of my program:
>>     begohandler.py
>>     mac.py
>>     ...
>>     syslogdb.py
>>     matlab.py
>>     ...
>>     arrow.py

More information about the Tutor mailing list