| | |
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: 4552 | Replies: 13
| Thread Tools | Search this Thread |
Tag cloud for Python
approximation array beginner book builtin change cipher clear client code color converter countpasswordentry cturtle curved def dictionary drive dynamic examples excel file float format ftp function gui homework import inches input java library line lines linux list lists loop microcontroller mouse mysqldb mysqlquery newb number numbers output parsing path plugin port prime program programming projects py2exe pygame pymailer pyqt python random recursion recursive redirect remote script scrolledtext search singleton socket sqlite ssh string strings strip subprocess sum syntax table terminal text textarea thread threading time tkinter tlapse tuple tutorial twoup ubuntu unicode urllib urllib2 variable vigenere wikipedia windows wxpython xlwt




.

