Re: Help with the 3rd Lecture, first tutorial
2007-11-01 01:19:37 GMT
(1) I run python by c:\Python25>Python <Enter>
Once in the interpreter, I can import the pygame modules, initialize Python, make a window, but when I try to set the caption it won't work. I did get it to work in the GUI, however.
(2) C:\Program Files\examples\data\chimp.bmp "Is the path to the image"
When trying to load the image with:
>>> print monkey_head_file_name "Creating a relative Path"
monkey_surface = pygame.image.load(monkey_head_file_name) "From the tutorial...trying to load the image"
-----BEGIN PGP SIGNED MESSAGE-----
Michael George wrote:
> Everything after the > is what you type at the dos prompt. Everything
> after the >>> is what you type at the python prompt. Everything else is
> what you should expect the system to respond
It's a little more complicated than that, of course:
>> >>> file = open("file.txt")
>> >>> Traceback (etc...)
You aren't supposed to type "Traceback (etc...)". Lukasz believes you
may get a traceback here from an error (for example, a file-not-found
>> >>> [ctrl+d]
This presumably means "press Ctrl-D" rather than "type [ctrl+d]". I'm
not sure if this is correct; I thought on Windows, EOF is Ctrl-Z? But
I wouldn't swear to it.
>> > cd files
>> > dir
>> > python
>> >>> file = open("file.txt") (and it work!)
And here "(and it work!)" is presumably a comment.
However, if I were you, Kevin Hayes, I would refine what I meant by
"won't load". I believe Lukasz believes that you are getting "Cannot
find file" errors, and he is trying to show you how to find your way
around DOS and how your current directory interacts with Python.
If you are getting file-not-found errors, it may help to explain your
situation further -- what directory are you running Python from? What
directory is chimp.bmp in? And so on.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----