I am trying to develop a gui using wxpython that has 3-4 notebook panels and one of these panels (master panel) calls another python script called abc.py. In this abc.py i am running several(>10) threads simultaneously. When I hit run button on master panel it starts these simultaneous threads of abc.py script. The problem I am facing here is my wxpython notebook gets hang up for time between: "when I hit run button and upto all the threads are joined". For this period I am not able to control other buttons on my panel nor am i able to switch between panels. My window gets freezed up for this period of time. What could be the problem? If anyone could guide me to proper path to avoid this issue then i will really be very grateful. Thank you..!!!
相关问题
- limit number of threads working in parallel
- wxPython and PyCharm on Mac
- Can't pickle Pyparsing expression with setPars
- Check if Timer.cancel is called in unit test
- python: Right Click on list menu not showing item
相关文章
- How to print to stdout from Python script with .py
- ImportError: No module named cycler
- Where is the memory leak? How to timeout threads d
- Show progressbar in Qt with computationally heavy
- How to implement a thread in a wxPython GUI applic
- Running winpdb from within Enthought Canopy on Mac
- Why is my output from a subprocess delayed, when i
- How can I package my python application with exter
You will also need to wrap the call to
abc.py
(withpopen
, I suppose) into a thread, otherwise the GUI will block. When the process in the external script is collecting its answer, you have to get it back in a thread-safe way (important!) towxPython
.A better way would be to import from
abc.py
, if that is possible and spin the imported objects in the long running thread.For an explanation how to communicate back thread-safe see the wxPython wiki. I personally find the last example the easiest to understand and implement.