suppose i'm calling two system processes, one to unzip, and one to
“tail†to get the last line. How can i determine when the first
process is done?
Example:
subprocess.Pope n([r"/sw/bin/gzip","-d","access_log. 4.gz"]);
last_line=subpr ocess.Popen([r"/usr/bin/tail","-n 1","access_log. 4"],
stdout=subproce ss.PIPE).commun icate()[0]
of course, i can try workarounds something like os.system("gzip -d
thiss.gz && tail thiss"), but i wish to know if there's non-hack way to
determine when a system process is done.
Xah
xah@xahlee.org
∑ http://xahlee.org/
“tail†to get the last line. How can i determine when the first
process is done?
Example:
subprocess.Pope n([r"/sw/bin/gzip","-d","access_log. 4.gz"]);
last_line=subpr ocess.Popen([r"/usr/bin/tail","-n 1","access_log. 4"],
stdout=subproce ss.PIPE).commun icate()[0]
of course, i can try workarounds something like os.system("gzip -d
thiss.gz && tail thiss"), but i wish to know if there's non-hack way to
determine when a system process is done.
Xah
xah@xahlee.org
∑ http://xahlee.org/
Comment