Is there a way to decode numerical COM error-codes in pywin32

前端 未结 5 1077
别那么骄傲
别那么骄傲 2020-12-28 15:26

Here is part of a stack-trace from a recent run of an unreliable application written in Python which controls another application written in Excel:

pywintype         


        
5条回答
  •  醉酒成梦
    2020-12-28 15:49

    Yes try the win32api module:

    import win32api
    e_msg = win32api.FormatMessage(-2147352567)
    

    You can grab any codes returned from the exception and pass them to FormatMessage. Your example had 2 error codes.

提交回复
热议问题