Don't Laugh....

Kevin Cazabon kcazabon at home.com
Wed Mar 15 00:33:32 EST 2000


The problem actually is that your module isn't on the PYTHONPATH.  So, the
python interpreter can't find it.

calling it from a DOS shell, as suggested by Dana Booth, will work fine, as
long as Python.exe is on your Windows PATH, which it should be if you used
the installer.

The other thing you can do is add the directory that your module is in to
the PYTHONPATH... which can be done through PythonWin, or in the Windows
registry.

Kevin.



"Dana Booth" <dana at oz.net> wrote in message
news:8an4g7$i3g$0 at 216.39.141.21...
> Akira Kiyomiya <akira.kiyomiya at autodesk.com> wrote:
>
> AK: I created one document called "module.py" by using my text editor  The
> AK: "module.py" only has a sentense " print 'Hello World!'"  and that's
it.
>
> AK: I saved this file on my desktop and c drive, so I simply typed
>>>module.py
> AK: but I keep getting a message "Traceback <innermost last>: File
"<stdin>",
> AK: line1 , in ? NameError: module"
>
> From dos command line, try:
>
> python c:\windows\desktop\module.py
>
> The interactive interpreter has its reasons for being, but almost
everything
> you do will probably be interpreting a file like in the above example.
>
> BTW, I'm also fairly new to using Python, but I've found it to fill a
> perfect niche between the ease of Perl and the low-level abilities of C.
> Anyway, the point being is that it's almost identical to Perl in how I
call
> it files from the shell, usually with a pound/bang in UNIX or as a command
> line arguement in Windows. Good luck!
>
> --
> -----
> Dana Booth <dana at oz.net>
> Tacoma, Wa., USA
>
> key at pgpkeys.mit.edu:11371





More information about the Python-list mailing list