I need to make some command line calls to linux and get the return from this, however doing it as below is just returning 0
when it should return a time value, like 00:08:19
, I am testing the exact same call in regular command line and it returns the time value 00:08:19
so I am confused as to what I am doing wrong as I thought this was how to do it in python. Any advice is appreciated.
import os
retvalue = os.system("ps -p 2993 -o time --no-headers")
print retvalue