The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

This topic is READ ONLY
BobCarder (2) [Avatar] Offline

My son and I are attempting chapter 16 on our Macs running 10.6.7 Snow Leopard. We had a problem on my son's Mac so I tried it on mine using the Mac installer supplied via your site.

On both machines the same problem happens with the code in listing 16.1:
import pygame
screen = pygame.display.set_mode([640, 480])

When we run this code the black window pops up but it doesn't go away - it stays there and whenever you move the cursor over it the busy mac beachball appears. The only way to get rid of it is to exit IDLE.

Both machines had Python installed via you Mac installer. When we did chapter 10 (the skiing game) we were using a Windows machine which we no longer have. All other chapters since have chapter 10 (when we switched to Macs) have worked fine.

I understand you now have a Mac - if you could please test this out and advise how to resolve it we would be very appreciative. We love your book and don't want to get stuck here.

carter.sande (32) [Avatar] Offline
Re: PYGAME on MAC Snow Leopard 10.6.7
This is happening because of Pygame's incompatibility with IDLE. (You can find out more about the incompatibility on page 176)

You can fix this by using SPE, where this problem doesn't occur.

BobCarder (2) [Avatar] Offline
Re: PYGAME on MAC Snow Leopard 10.6.7
Brilliant. Thanks Carter. Sorry I missed it.
NikBhatt (3) [Avatar] Offline
Re: PYGAME on MAC Snow Leopard 10.6.7
It's still not working for us.

I've tried SPE. Same beachball problem as with IDLE. I've tried to type the commands directly into Terminal, same result.

I noticed that pygame outputs this when the set_mode function is called:

2012-03-02 19:49:38.352 Python[351:903] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.

Perhaps we have an old version? How do we tell what version we have and if there is a newer one?

NikBhatt (3) [Avatar] Offline
Re: PYGAME on MAC Snow Leopard 10.6.7
We have Python 2.5 and I just installed pygame 1.9.1 but I still get a beachball with SPE and IDLE...

Ideas are welcome!


NikBhatt (3) [Avatar] Offline
Re: PYGAME on MAC Snow Leopard 10.6.7
Solved it. If we just enter the code in Listing 16-1, then the app hangs (in IDLE or SPE). However, if we create a file with those statements and run it in the shell, it works fine.
If we put in the event handling code, then it works in IDLE and SPE.