Simple shell() function

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

Copy this code and paste it in your HTML
  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


RSS Icon Subscribe to comments

You need to login to post a comment.