On 05/10/2018 09:48 AM, Ganesh Pal wrote:
I have to test a standalone tool from a python script and I am using
os.system() to run the tool . I need to take decision based on the return
value of the standalone tool .

But since os.system merely throws the output value to STDOUT  & returns the
exit status (0 => no error) of the shell , how can I make this print Fail
or Pass based on the return value of the standalone tool.

In the below example ( return_values() function)


[snip]

By not using os.system, it's been superseded for reasons exactly like yours. https://docs.python.org/3/library/subprocess.html is your friend.


--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to