os.system(), execute a shell command, sensing the return-state

The function os.system() executes a shell command and return the return-state:

In [1]: import os 

In [2]: a = os.system( "notExist")
sh: 1: notExist: not found

In [3]: a
Out[3]: 32512

In [4]: a = os.system( "hostname")
haso107d1

In [5]: a
Out[5]: 0