"Grigor Kolev" <[email protected]> wrote
Can I use something like this
#--------------------------------------------------
import sys
sys.path.append("/home/user/other")
import module
#-------------------------------------------------
Yes but if you have a lot of modules in there that you might
want to use in other programs you might prefer to add the
folder to your PYTHONPATH environment variable. That
way Python will always look in that folder for your modules.
Thats what I do - I gave a folder whee I put all my reusable
modules. This folder is not under my Python install folder
so that when I install a new Python and delete the old I
don't lose my code... And the PYTHONPATH variable
works with the new Python.
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor