[chimera-dev] Direct standard output to Reply Log
anchorwz at googlemail.com
Tue Dec 2 14:23:29 PST 2014
I am new to write Chimera code. Right now I am trying to run another program as a subprocess within Chimera.
While I was trying to redirect the standard output from the subprocess to “Reply Log”, the results could be shown only after the subprocess finished but not simultaneously. I was wandering how should I redirect the output to “Reply Log” while the subprocess program is running.
Right now I have something like this:
for line in sub.stdout:
subproc = SM.Popen(cmd, stdin=None, stdout = SM.PIPE, stderr=SM.PIPE)
subprog = SM.monitor(‘prog’, subproc, title=‘run’, task=task, afterCB=show(subproc))
If I run this block within the IDLE, then the result printed while it is running (seems still a bit delayed).
Where should I change?
Thank you in advance.
More information about the Chimera-dev