|
|
|
|
@ -108,17 +108,11 @@ def detect_markers(psid, pid):
@@ -108,17 +108,11 @@ def detect_markers(psid, pid):
|
|
|
|
|
# ######################################## |
|
|
|
|
|
|
|
|
|
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
|
|
|
|
# 检查进程是否完成 |
|
|
|
|
while True: |
|
|
|
|
retcode = process.poll() # 返回值为None表示进程尚未结束 |
|
|
|
|
if retcode is not None: |
|
|
|
|
# 如果进程已经完成,打印退出状态码 |
|
|
|
|
print(f"Process exited with code: {retcode}") |
|
|
|
|
break |
|
|
|
|
else: |
|
|
|
|
print("Process is still running...") |
|
|
|
|
time.sleep(1) # 每隔1秒检查一次 |
|
|
|
|
# 使用 communicate() 等待进程完成 |
|
|
|
|
stdout, stderr = process.communicate() |
|
|
|
|
# 获取进程的退出码 |
|
|
|
|
exit_code = process.returncode |
|
|
|
|
print(f"Process exited with code: {exit_code}") |
|
|
|
|
print(f"Output: {stdout.decode()}") |
|
|
|
|
print(f"Error: {stderr.decode()}") |
|
|
|
|
print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") |
|
|
|
|
|