I am trying to get the following python code to work, I am just not able to get the syntax to work. Can someone assist?
import subprocess
import shlex
subprocess.call(shlex.split('top -d 5 -n 1 -b -o %CPU | head -n 12 > output.txt'))
				I am trying to get the following python code to work, I am just not able to get the syntax to work. Can someone assist?
import subprocess
import shlex
subprocess.call(shlex.split('top -d 5 -n 1 -b -o %CPU | head -n 12 > output.txt'))
				Copyright © 2021 Jogjafile Inc.
                        
I got the below to work, Thanks for help!