| | |
pygame window not werking
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
•
•
Are you guys putting the code into the interactive python interpreter or are you creating a separate .py file. When I started my first pygame project, I tried putting it in the interpreter and got an Not Responding window. Of course I just started python and pygame so what do I know.
Last edited by evstevemd; Jan 4th, 2009 at 2:24 pm. Reason: clear up confusion
•
•
•
•
I don't remember the full syntax, nor if it is actually what you are looking for but try
Python Syntax (Toggle Plain Text)
pygame.display.flip()
I've since found another tutorial that enlightened me re: the Not Responding window. It turns out the reason the window is 'not responding' is because our code is literally not responding to its event queue. Mouse clicks, mouse moves, key presses, and in fact lots of other random crud too, all pile up in the Windows Message Queue, and when Windows detects that a program isn't processing its messages (and thereby removing them from the queue - kind of like not reading your mail and letting it pile up in the mailbox), then Windows marks that window "Not Responding".
Python Syntax (Toggle Plain Text)
pygame.event.get() # returns a list of events. I haven't read ahead enough to know how to # deal with them individually, i.e. look for typed letters # (as opposed to scanning the keyboard contstantly, hoping you don't miss one...) # ... but I have determined that calling this function: # - clears the message queue # - makes the game window's 'Not Responding' tag go away # - allows all the drawn changes to show up
•
•
•
•
Are you guys putting the code into the interactive python interpreter or are you creating a separate .py file. When I started my first pygame project, I tried putting it in the interpreter and got an Not Responding window. Of course I just started python and pygame so what do I know.
Try this from the interpreter (after creating a window)
to see all the events a window typically recieves.
Python Syntax (Toggle Plain Text)
while True: print pygame.event.wait()
![]() |
Similar Threads
- More pygame trouble. Toggle window not working. (Python)
- Pygame crashing (Python)
- JavaScript's window.opener (JavaScript / DHTML / AJAX)
- I need window~1.ani (Windows NT / 2000 / XP)
Other Threads in the Python Forum
- Previous Thread: Class module help
- Next Thread: Google Results and Python
Views: 4550 | Replies: 13
| Thread Tools | Search this Thread |
Tag cloud for Python
advanced assignment beginner bluetooth chmod cmd code convert count csv data decimals dictionary dynamic dynamically enter examples excel external file float format frange ftp function gnu gui heads hints homework import input jaunty java leftmouse line linux list lists loan loop module mouse multiple newb number numbers output parsing path pointer port prime program programming projects push py2exe pygame pyglet pyopengl pyqt python random raw_input recursion recursive scrolledtext slicenotation software ssh stderr string strings table tennis terminal text thread threading time tkinter tlapse tooltip tuple tutorial ubuntu unicode unix urllib urllib2 variable variables ventrilo web webservice windows wx.wizard wxpython xlib




.

