This topic is READ ONLY
dsloan (4) [Avatar] Offline
#1
Thanks for the book - for someone with pretty much no experience, it has been a great way to get started.

I'm having some trouble with the listings in Chapter 16. I have the same problem in IDLE and in SPE.

After I entered the code from 16.1, the black window appeared, but did not go away, as the chapter says it should. I fretted over that for a while, then decided to just move on. I've entered the code through 16.4. At first, I couldn't close the black pygame window. Now I can close it. But it stays black. I have less than no idea what the problem might be.

Help, anyone?

Message was edited by:
dsloan
warren.sande (211) [Avatar] Offline
#2
Re: Great Book! Having trouble at the beginning of Ch. 16.
dsloan,

Glad you're enjoying the book. Sorry to hear about your troubles in Ch 16.

First, what operating system are you running?

Second, I don't quite understand the statement: "Now I can close it. But it stays black."

If you closed the window, what is black? Can you send a screen shot?

Are you getting any error messages in the SPE or IDLE console?


Warren Sande
dsloan (4) [Avatar] Offline
#3
Re: Great Book! Having trouble at the beginning of Ch. 16.
Ha! I can see how those two things together might not make sense. I blame faulty sentence construction. smilie I meant to say that I can now close the window (I couldn't do that at one point), but any time I open it by running the program, the contents of the window are black - as opposed to white with a red circle, as Listing 16.4 says it should be. I hope that makes more sense. If it doesn't, I still take a screen shot.

I am running Ubuntu Desktop 10.10.
warren.sande (211) [Avatar] Offline
#4
Re: Great Book! Having trouble at the beginning of Ch. 16.
Okay, it makes sense. Two more questions...

1. Any error messages, either when you run the program or when you close the window?

2. Did you type the code in yourself? Or run the code from the 'examples' folder (or the web site)?

If you typed it in, would you mind sending a copy to cp4khelp@yahoo.com ?

(This forum strips whitespace, so posting it here doesn't work.)


Regards,
Warren
warren.sande (211) [Avatar] Offline
#5
Re: Great Book! Having trouble at the beginning of Ch. 16.
Actually, one more question...

3. Did you run the Hello World installer, or install Python (and Pygame) from some other source? If you didn't run our installer, what version of Python are you running?


Warren
dsloan (4) [Avatar] Offline
#6
Re: Great Book! Having trouble at the beginning of Ch. 16.
Thanks so much for the excellent and thorough response.

I did type in the code myself, and I do not get any error messages when I run the program or close the window.

Python 2.6 was already installed on my computer when I purchased the book. I was reading another forum after I read your response and I did realize that this may be the problem. Perhaps I should install 2.5 and give it another go before troubling you with an email?

Thanks again.
dsloan (4) [Avatar] Offline
#7
Re: Great Book! Having trouble at the beginning of Ch. 16.
Okay...apparently I was just having a moment of silliness. I went ahead and ran the example file for Listing 16.4 and it worked just fine. So I put my own code next to that code on the screen (which I thought I had done a fairly good job of with the code in the book, but apparently not) and discovered that I was simply missing the "()" following at the end of the line that begins "for event" in the while loop block.

I have fixed that and now I have the white background with the red circle. Last remaining question - when I run the program, either from my own typed in code or from the example file, I get two windows - one black, the other one white with the red circle. I assume this is okay?

Thanks again for your time and attention.
warren.sande (211) [Avatar] Offline
#8
Re: Great Book! Having trouble at the beginning of Ch. 16.
Yes, the black window is the "console" window. Every Pygame program will have a console window along with the graphics window. This is normal.

Glad you got it working!


Regards,
Warren