Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
“应用程序未能正确初始化...单击确定,终止应用程序。” 是来自错误弹出窗口的消息。在 Python 代码中捕获这些错误的方法是什么?
听起来很熟悉?这将永远阻止您subprocess.Popen.. 直到您单击“确定”按钮。将以下代码添加到模块初始化以解决此问题:
subprocess.Popen
import win32api, win32con win32api.SetErrorMode(win32con.SEM_FAILCRITICALERRORS | win32con.SEM_NOOPENFILEERRORBOX)