Posted By

jacobian on 09/20/06


Tagged

Shell python


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

anayhk


Simple shell() function


 / Published in: Python
 

  1. def shell(*cmd):
  2. pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  3. stdout, stderr = pipe.communicate()
  4. return pipe.returncode, stdout, stderr

Report this snippet  

You need to login to post a comment.