1234567891011121314 |
- import subprocess
- filepath="start.bat"
- import time
- import threading
- def start(filepath):
- p = subprocess.Popen(filepath, shell=True, stdout=subprocess.PIPE)
- stdout, stderr = p.communicate()
- print(p.returncode) # is 0 if success
- while True:
- # 异步
- # t = threading.Thread(target=start, args=[filepath]);
- # t.start();
- #同步,等所有执行完后,再执行
-
|