Linux command-line call not returning what it should from os.system?

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.

import os
retvalue = os.system("ps -p 2993 -o time --no-headers")
print retvalue
58
задан Drise 12 March 2018 в 14:37
поделиться