Size: 689
Comment:
|
Size: 740
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
[http://groups.google.com/group/comp.lang.python/msg/7edd2c4b0c7fe185 this Usenet posting]. No single answer is canonical; there are, however, a number of expedients which apply in at least some situations: | [http://groups.google.com/group/comp.lang.python/msg/7edd2c4b0c7fe185 this Usenet posting]. No single answer is canonical, for each has definite liabilities and limitations; there are, however, a number of expedients which apply in at least some situations: |
Line 5: | Line 5: |
* put the subprocess in its own thread, and rely on Python thread management ...; | * put the subprocess in its own thread, and rely on Python ThreadProgramming ...; |
Line 7: | Line 7: |
* the particular GUI framework involved--wxPython, tkinter, ... | * the particular GUI framework involved--wxPython, TkInter, ... |
This frequently-asked question appears, for example, in [http://groups.google.com/group/comp.lang.python/msg/7edd2c4b0c7fe185 this Usenet posting]. No single answer is canonical, for each has definite liabilities and limitations; there are, however, a number of expedients which apply in at least some situations:
- "fire and forget", that is, put the subprocess in the background and let it run freely;
- put the subprocess in the background, return to the GUI's event loop, and poll to detect when the subprocess has terminated;
put the subprocess in its own thread, and rely on Python ThreadProgramming ...;
- ...
the particular GUI framework involved--wxPython, TkInter, ...
- ...
[links, explanations, warnings]