Trying to use "Programming Python" (Lutz), getting module errors.
Rob Lineberger
robline at purdue.edu
Mon May 6 11:22:56 EDT 2002
>
> I would recommand you start learning Python by reading "Learning
> Python" (also by Mark Lutz & David Ascher), not "Programming Python"
> ... :)
Sorry, it was late and I was befuddled. I am indeed using the book
"Learning Python".
> However if you put your spam.py in C:\Python22\Lib then typing 'import
> spam' inside Pythonwin / IDLE should work ...
Then I am stumped. This is what I did (From memory, so if my code is
wrong please refer to the book). Page 12 says something like:
>>>> print "Hello World!"
Did so and it printed Hello World!.
Then the book says to open a text editor and create a module, for
example myfile.py looks like this:
title="A Fish Called Wanda"
I created the above file and saved it as myfile.py into the
C:\Python22\Lib directory. I went to said directory and confirmed it
was there. double clicked it and a black DOS window flashed briefly
on the screen.
Then I opened pythonwin and typed:
>>>> import myfile.py
Got an error that read something like this:
"No such module exists"
Thanks again for any light you can shed.
More information about the Python-list
mailing list