jmunsch

Python: return bash output

Aug 12th, 2014
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.12 KB | None | 0 0
  1. import subprocess
  2. process = subprocess.Popen(["yourcommand"], stdout=subprocess.PIPE)
  3. result = process.communicate()[0]
Advertisement
Add Comment
Please, Sign In to add comment