See this simple code:
$ python
>>> from subprocess import *
>>> call(['echo','Hi'])
Hi
0
My problem looks simple. I don’t want this 0 at the end of the call.
Every function called by call appears with this and this messes up things for conditional tests.
Something like:
if int(call(['function', 'parameter']))>10:
print 'yes'
So how can I receive only
Hi
in this example?
You want to use Popen with
communicate, as described in the docs: