[Tutor] Python 2.0 newbie questions
alan.gauld@bt.com
alan.gauld@bt.com
Fri, 27 Oct 2000 11:11:50 +0100
> First make sure your path is set. Here's what I have(on Win98): SET
> PATH=C:\PYTHON20;%PATH%
> Create a folder in the Python directory, such as "mypython".
> Create the file, such as "hello.py"
> Save it in the "mypython" directory.
In which case you should also add to your AUTOEXEC:
SET PYTHONPATH=C:\PYTHON20\MYPYTHON
Then you don't need to do this:
> Go to the command line, IDLE or PythonWin and at the prompt, type...
> import os
> os.chdir('C:\PYTHON20\MYPYTHON') #make sure to include the single
> quotes
Since Python now knows where to look for your modules when you do:
> import hello
HTH,
Alan G.