execjs模块下_external_runtime.py里面一个类里的_exec_with_pipe(self, source)函数,有以下代码,Popen命令行执行的nodejs
p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, cwd=self._cwd, universal_newlines=True)
改成如下:
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
p = Popen(cmd, startupinfo=startupinfo, stdin=PIPE, stdout=PIPE, stderr=PIPE,cwd=self._cwd, universal_newlines=True)
文章讨论了在execjs模块的_external_runtime.py文件中,如何修改_Popen函数调用,特别是将Popen命令行执行的nodejs部分添加了STARTUPINFO设置,以控制窗口显示。这一改动涉及进程启动信息(startupinfo)的标志位STARTF_USESHOWWINDOW,用于控制子进程窗口的行为。
2342

被折叠的 条评论
为什么被折叠?



