如果你的python代码中有导入logging模块,如果程序有引用comtypes模块,那么程序在异常时候可能会出现一些comtypes模块的logging信息,比如:“INFO:Imported existing <module ‘comtypes.gen’ from ‘\site-packages\comtypes\gen\init.py’"及"INFO: Using writeable comtypes cache directory:'\sit-packages\comtypes\gen’”,如果想屏幕这些信息,你可以尝试在程序导入模块代码块下面添加如下语句:
logging.getLogger(“comtypes”).setLevel(logging.CRITICAL)
祝你好运!