determine if os.system() is done

Xah Lee xah at
Wed Sep 7 11:58:35 CEST 2005

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?



last_line=subprocess.Popen([r"/usr/bin/tail","-n 1","access_log.4"],

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 at xahlee.org

More information about the Python-list mailing list