IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
17.1.1.1 Convenience Functions

17.1.1.1 Convenience Functions

This module also defines two shortcut functions:

call( *popenargs, **kwargs)
Run command with arguments. Wait for command to complete, then return the returncode attribute.

The arguments are the same as for the Popen constructor. Example:

    retcode = call(["ls", "-l"])

check_call( *popenargs, **kwargs)
Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute.

The arguments are the same as for the Popen constructor. Example:

    check_call(["ls", "-l"])

See About this document... for information on suggesting changes.