tmp.py 360 B

123456789101112
  1. import subprocess
  2. import sys
  3. def run_shell(shell):
  4. cmd = subprocess.Popen(shell, stdin=subprocess.PIPE, stderr=sys.stderr, close_fds=True,
  5. stdout=sys.stdout, universal_newlines=True, shell=True, bufsize=1)
  6. cmd.communicate()
  7. return cmd.returncode
  8. run_shell("tail -f C:/Users/root/IdeaProjects/python-base/index.html")