1
This commit is contained in:
1 parent
6658d79fd8
commit
af67fbcc0c
1 file changed
+20
-1
@@ -103,7 +103,26 @@ def detect_markers(psid, pid):
|
||||
{textpicCmd} -save "{os.path.join(config["workdir"], pid, f"{pid}.rcproj")}" -quit'
|
||||
print(cmd)
|
||||
cmd = shlex.split(cmd)
|
||||
res = subprocess.run(cmd)
|
||||
#res = subprocess.run(cmd)
|
||||
|
||||
# ########################################
|
||||
|
||||
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秒检查一次
|
||||
stdout, stderr = process.communicate()
|
||||
print(f"Output: {stdout.decode()}")
|
||||
print(f"Error: {stderr.decode()}")
|
||||
# ########################################
|
||||
|
||||
time.sleep(3)
|
||||
fix_region()
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 定位点检测完成, 共费时{diff_time(start_time)}')
|
||||
|
||||
Reference in new issue
Block a user