Get output from os command in Python


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. from subprocess import Popen
  2. from subprocess import PIPE
  3.  
  4. bla = Popen(["ls", "-l"], stdout=PIPE).communicate()[0]

URL: http://docs.python.org/library/subprocess.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.