So I've got this to find out if a process is running or not:
os.system("ps aux | grep [my]process")
I use the square brackets so I don't get back the grep command too.
Altho when I try to do something like
'yes' if os.system("ps aux | grep [my]process") else 'no'
I always get no, even if in fact python print the line with the info of the process.
Pretty sure that there must be some sort of misunderstanding from my side...I assume that if the output of os.system is not zero, the expression resolve in true, so I should get 'yes'. But this does not happen at all, I get no, even if the process is there running, and the command return correctly the info about the process.
What am I doing wrong here?
Thanks!