import subprocess import sys params = [ { "name": "k8s", } ] def run_shell(shell): cmd = subprocess.Popen(shell, stdin=subprocess.PIPE, stderr=sys.stderr, close_fds=True, stdout=sys.stdout, universal_newlines=True, shell=True, bufsize=1) cmd.communicate() return cmd.returncode if __name__ == '__main__': pass run_shell("tail -f C:/Users/root/IdeaProjects/python-base/index.html")