当我使用subprocess.call([''notepad.exe',path])时,我的应用程序没有响应。有人知道原因吗?
(记事本正确打开路径中的文件)
答案 0 :(得分:1)
您正在负责GUI的线程上运行此命令。仅在被调用程序终止时才返回对subprocess.call
的调用。在它仍在运行时,该功能只是坐在那里等待,因此您的GUI也被迫等待。
为避免这种情况,请在另一个线程中运行此功能或使用a non-blocking cousin of subprocess.call
。