[Tutor] import a module
alan.gauld at freenet.co.uk
Wed Dec 21 22:09:50 CET 2005
And to add to Kent's comments....
>> C:\Documents and Settings\Christopher Spears\My
>> I want to launch IDLE, import the file, and use it. I
>> import "C:\Documents and Settings\Christopher
> You can't give a full path to the import statement. The module to be
> imported has to be somewhere in sys.path.
And once you have it in the path you do NOT add the .py at the end.
And to add yet another possibility for setting the sys.path, you can add
your folder to the PYTHONPATH environment variable, by editing
AUTOEXEC.BAT in Win9x or by setting the value in the
"MyComputer->Properties->Advanced" dialog tab.
More information about the Tutor