Hey all,

I have a debugging tip that I use when I have a bug I can't replicate:

in the main key_press function:

def on_key_press(self, symbol, modifiers):
        if symbol == key.Q:
            self.has_exit=True
        elif symbol == key.D:
            import pdb
            pdb.set_trace()

now if you run your game and hit d, you'll be in dropped into the
debugger right after the call to set_trace() (so basically in the
middle of your event loop). From here you can usually walk the call
graph, and investigate things if need be, or set breakpoints, etc. If
you hit 'c' at the debugger prompt your program will continue running.
Of course, you probably want to remove this code when you finally
release your product :)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to