设置参数: creationflags=0x08000000 可以隐藏命令行窗口
def run(self):
# creationflags=0x08000000 使用 pyinstaller 打包成 exe 时隐藏命令行窗口
self.process = subprocess.Popen(self.cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=1,creationflags=0x08000000)
while self.process.poll() is None:
out = self.process.stdout.readline().decode("utf-8").strip()
self.log.emit(out)