Last active
June 11, 2019 13:29
-
-
Save Daemonslayer2048/15eda9149fc8d4c13768f24ecd9bd481 to your computer and use it in GitHub Desktop.
Reading output from subprocess.Popen #Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def clear_schedule(): | |
output = subprocess.Popen(['atq'], stdout=subprocess.PIPE, shell=True) | |
queue = output.communicate()[0].decode('utf-8') | |
for job in queue.splitlines(): | |
qid = job.split('\t', 1)[0] | |
print (qid) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment