From 6658d79fd8b9606165760acfc948a2f0cf156189 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Fri, 10 Jan 2025 23:37:44 +0800 Subject: [PATCH] 111 --- yj_local_build/main_step1.py | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/yj_local_build/main_step1.py b/yj_local_build/main_step1.py index a369ca8..08f0a26 100644 --- a/yj_local_build/main_step1.py +++ b/yj_local_build/main_step1.py @@ -103,29 +103,7 @@ 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) - # 使用 Popen 来执行命令 - process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - - # 检查命令是否执行完毕 - while True: - return_code = process.poll() # 获取进程的退出码,None 表示进程仍在运行 - if return_code is not None: - print("Command finished with return code:", return_code) - break - print("Command is still running...") - time.sleep(1) # 每秒检查一次进程状态 - - # 获取命令的输出 - stdout, stderr = process.communicate() - - # 打印输出结果 - if return_code == 0: - print("Command executed successfully.") - print(f"Output: {stdout.decode()}") - else: - print(f"Command failed with return code {return_code}") - print(f"Error: {stderr.decode()}") + res = subprocess.run(cmd) time.sleep(3) fix_region() print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 定位点检测完成, 共费时{diff_time(start_time)}')