com_error功能不在pythoncom中
我正在研究一个我们将Aspen Plus与Python联系起来的项目,因此我们可以应用强化学习代理人设计和优化分离列车。同时,已经解决了许多错误,但目前我对以下错误感到疑惑: pywintypes.com_error:(-2147352567,“异常发生”
。错误,但是com_errors在常规上不能截获,除非语句。 在线我找到了使用以下语句的解决方案:
try:
...
except pythoncom.com_error:
...
此语句似乎对我不起作用,因为我会收到警告: 在“ pythoncom.py”中找不到参考“ com_error”,
有人有一个想法解决这个问题吗? 帮助您非常感谢! 在此处输入图像描述
I am working on a project in which we link Aspen Plus to Python, so we can apply a reinforcement learning agent to design and optimize a separation train. Meanwhile a lot of errors have been fixed, but currently I am stuc on the following error:
pywintypes.com_error: (-2147352567, 'Exception occurred.', (1, 'Aspen.Unknown', 'No message available', None, 0, 0), None)
I tried to use a try and except statement to intercept this error, but com_errors are not interceptable in regular except statements.
Online I found solutions which use the following statement:
try:
...
except pythoncom.com_error:
...
This statement does not seem to work for me, since I get a warning:
Cannot find reference 'com_error' in 'pythoncom.py'
Does anyone has an idea to solve this?
Help is much appreciated!
enter image description here
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论