Differences between revisions 2 and 3
Revision 2 as of 2008-08-31 16:24:44
Size: 689
Editor: CameronLaird
Comment:
Revision 3 as of 2008-08-31 16:49:10
Size: 740
Editor: CameronLaird
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]

How do I keep a GUI alive during a long-running subprocess? (last edited 2008-11-15 14:00:04 by localhost)

Unable to edit the page? See the FrontPage for instructions.