I can run ps aux | grep python_script.py
and get the details of the process running the script. I want to be able to run the same command from python script.
from subprocess import call
call(["ps", "aux"])
works well, however tried these lines but both returns error,
call(["ps", "aux", "|", "grep", "python_script.py"])
call(["ps", "aux", "| grep python_script.py"])
Returns error, can someone please advise me on how to run ps aux | grep python_script.py
from command line