os.wait()
Waits for a spawned subprocess.
Signature
os.wait(handle[, timeout])
Parameters
Open process and optional duration in seconds or null. Default is the process's configured timeout.
Returns
Process result dictionary.
Behavior
Collects both streams. A timeout, interruption or capture failure during waiting terminates and closes the process.
Errors
Invalid handle, timeout, capture failure or invalid UTF-8.
Example
use os
if os.platform != 'windows':
p = os.spawn(['echo', 'Atom'])
assert(os.wait(p, 2).stdout == 'Atom\n')
os.close(p)