Skip to content Skip to sidebar Skip to footer

Wxpython App: No Error But Still Freezes

I don't get any errors with my code, but after I hit the spam button it freezes and nothing happens. Does anyone see anything wrong with the code? import Skype4Py, wx, time as

Solution 1:

Building off of kotlinski's answer, yes its freezing because you are doing an endless loop in the main thread of your application. The app can no longer process any gui-related interaction or events.

While I don't know much wx, the theory is the same as PyQt. You should never block the main thread of your app with any long running or heavy lifting operations. Those should be run in separate threads and communicating back with signals:

http://wiki.wxpython.org/LongRunningTasks

Your main thread should always be clear to handle user interaction with the widgets.

Solution 2:

It probably freezes because your application goes into an endless loop here:

while 1:
        chat.SendMessage(message)

Post a Comment for "Wxpython App: No Error But Still Freezes"