954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

update_when('key_pressed') does NOT "end_graphics()"

Hi everyone! ^_^

I'm learning Python with " How to Think Like a Computer Scientist - Learning with Python 2nd Edition (Using Python 2.x) ".

I'm trying to use GASP & Pygame to do the practice excercises, but once the program runs, the window just keeps freezing, and I get an error message.

My version of Python is 2.6.4
My version of Pygame is 1.9.1
My version of GASP is python-gasp-0.2.0beta1.win32.exe
I used those because that's what the download website recommended as the most stable for Windows. (Windows 7)

Here's the code that I'm using:

from gasp import *

begin_graphics()

Circle((200, 200), 60)
Line((100, 400), (580, 200))
Box((400, 350), 120, 100)

update_when('key_pressed')
end_graphics()

That's all copy-pasted directly from the website.
In this case, the update_when('key_pressed') does not end the program. The pygame box just sits there, and won't exit even by clicking the button. The only way I could end the program was by the Task Manager.

I've searched the web for a solution, but what the common consensus seems to be is that "Unfortunately, the newer version will not work on Windows. Looks like the gasp project has gone/fizzled the way of many other Python projects."

So my questions are:
1) What other code can I use to shut down the gasp window? (It's really irritating to have to shut it down w/ the Task Manager each time.)

2) If there's really no other way, which older version can I use that will work with Windows? (I really, really, really wanna learn Python!!!)

Thanks in advance!!

Tsai Ming-Li
Newbie Poster
1 post since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: