From 8b191e9fc5da4318a909fb824460295f09d4db59 Mon Sep 17 00:00:00 2001 From: ll Date: Fri, 9 Jul 2021 18:19:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=80=A7=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyefun/compile/compile.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pyefun/compile/compile.py b/pyefun/compile/compile.py index e4fce0e..f0e32d5 100644 --- a/pyefun/compile/compile.py +++ b/pyefun/compile/compile.py @@ -236,15 +236,23 @@ def 定位模块所在路径(modelName): def cmd回显模式(cmd): - cmd = efun.路径优化(efun.取运行目录() + r"/resources/cmdrt.exe ") + cmd - # 日志.输出("cmd回显模式 {}".format(cmd)) + cmdrtPath = efun.文件从列表中选取存在的文件路径([ + efun.路径优化(r"C:/efun_view_system/resources/cmdrt.exe"), + efun.路径优化(efun.取运行目录() + r"/resources/cmdrt.exe"), + efun.路径优化(efun.取运行目录() + r"/cmdrt.exe"), + ]) + if cmdrtPath == "": + print("没有找到文件 cmdrt.exe 请配置易函数视窗编程系统安装包否则可能无法正常运行 现在使用兼容模式") + else: + cmd = cmdrtPath + r" " + cmd + proc = subprocess.Popen( cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, - # close_fds=True + close_fds=True ) try: proc = proc.communicate(timeout=5)