Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get output of ps aux grep python

import subprocess
cmd = "ps -ef | grep script.py | awk '{print $1,$2,$3,$4}’”
stdoutdata = subprocess.getoutput(cmd)
print("stdoutdata: " + stdoutdata.split()[0])
 
PREVIOUS NEXT
Tagged: #output #ps #aux #grep #python
ADD COMMENT
Topic
Name
6+4 =