Run Linux Command Using python script.

import subprocess
       
command = "ps aux | grep python"
p = subprocess.run(command, shell=True, capture_output=True)
output = p.stdout.decode('utf-8')
print(output)

Comments

Popular posts from this blog

ERR: error parsing query: found influx, expected SELECT, DELETE, SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line

How To Convert Html File/URL/String Into Image Using Python

How to get Full URL or get absolute url In Django