Pep 342 (val = yield MyGenerator(foo)), synchronous os.system() that doesn't block gui event loops
vivainio at gmail.com
Mon Jul 20 12:12:25 CEST 2009
Has anyone implementing something like what the subject line
To run functions that execute a series of system commands without
blocking the ui, *and* without adding state machine logic.
The syntax would be something like:
r = yield runshell("make")
r = yield runshell("make install")
# returns immediately, runs work() gradually in the background.
The catch is that showstatus() would need to be run in the mainloop,
so running the whole thing in a thread is a no-go.
I imagine runshell() would be implemented in terms of QProcess, or
subprocess.Popen/os.system and a worker thread.
Anyone done this already, or do I have to roll my own?
More information about the Python-list