Pygame... first tutorial help!

Started by
13 comments, last by cherokee596 16 years, 5 months ago
Oh yeah, that helps. Thank you. I used to know Dos, but it's been years. Thanks for the great refresher course!
Advertisement
I still can't load the monkey bitmap within IDLE. I tried typing in C:\Python25\data\chimp.bmp...but I get a "syntax error" message that points to the colon.

Thanks again for your help.
Can anyone help me with loading this image within Python Shell? My path should be C:\Python25\examples\data\chimp.bmp

Why won't the image load? I create a relative pathname with: monkey-head-file-name = os.path.join("data","chimp.bmp")


Then, I do: monkey_surface = pygame.image.load(monkey_head_file_name)

I can see that the M_H_F_N variable doesn't contain the whole path...so why would the image load?....Ok, so what am I missing?
Quote:Original post by cherokee596
I still can't load the monkey bitmap within IDLE. I tried typing in C:\Python25\data\chimp.bmp...but I get a "syntax error" message that points to the colon.

Thanks again for your help.


Don't forget the quotes around the "C:\Python25\data\chimp.bmp". Whenever you have a string literal (ie: a part of your code that is not code, but is rather plain-old text, for example, in print "Hello, world", notice how Hello, world is in quotes since it's text, not code) it must be surrounded by either quotes or single quotes.
Damn, I thought I had it all worked out and now, when I open Python within Program Files\examples...and then try to put a caption on the Window with pygame.display.set_caption('Monkey Fever') it won't make the caption. I didn't have trouble doing this within Python Idle Shell.

This topic is closed to new replies.

Advertisement