Atom

os.exec()

Runs a subprocess and waits for it.

Signature

os.exec(arguments[, options])

Parameters

Nonempty array of text containing the executable and its arguments, plus optional process options above.

Returns

Process result dictionary.

Behavior

Starts a child, sends input and captures streams synchronously.

Errors

Spawn, I/O, timeout, output limit or UTF-8 error.

Example

Atom
use os
if os.platform == 'windows':
    result = os.exec(['cmd.exe', '/c', 'echo Atom'])
else:
    result = os.exec(['echo', 'Atom'])
assert(result.code == 0)