On Fri, May 11, 2018 at 1:38 PM, Cameron Simpson <c...@cskk.id.au> wrote: > Returning to system() versus the subprocess module, there are other reasons > to prefer the subprocess module. The biggest is that os.system() runs a > shell command, a string passed to the programme /bin/sh. As such, that > string is subject to all manner of syntax - anything the shell can > understand.
Another good point about subprocess is that you can capture the OUTPUT of the called command, not just its return value. Hence it is the easiest and most obvious solution to the OP's problem - that os.system() leaves the output going to the screen, and thus cannot succeed or fail based on it. ChrisA -- https://mail.python.org/mailman/listinfo/python-list