我使用ffmpeg转换一些视频。 我用subprocess.Popen(...)调用命令
si = subprocess.STARTUPINFO()
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
self.my_pro = subprocess.Popen(cmd,
stdin=subprocess.PIPE,
stderr=subprocess.PIPE,
startupinfo=si)
(output, error) = self.my_pro.communicate()
我用这种方法杀了
self.my_pro.kill()
这是没有编译到exe的okey。
但我编译与pyinstaller
与--noconsole
子--noconsole
无法正常工作。 我必须将subprocess.Popen(...)
更改为subprocess.check_output(...)
但是这次我不能用self.my_pro.kill()
来杀死进程。
我怎么可以运行进程,我可以杀死它将运行pyinstaller noconsole?