gpt4 book ai didi

python - 名称错误 : global name 'windll' is not defined

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:16:19 25 4
gpt4 key购买 nike

我正在 linux(raspbian) 上运行 python(2.7) 文件。文件在尝试加载库之前运行良好。

运行Linux。不是 Windows。我已经在 Windows 机器上执行了这个程序,它没有任何问题。

完整错误:

Traceback (most recent call last):

File "mainMsg.py", line 42, in

instance = PCANBasic()

File "/home/pi/Alexa/PCANBasic.py", line 242, in init

self.__m_dllBasic = windll.LoadLibrary("PCANBasic")

NameError: global name 'windll' is not defined

我知道这个问题可能是因为 Windows 只有库?我正在寻找允许我的代码在 Linux 上运行的解决方案。

最佳答案

您可以捕获错误并处理它。

try:
instance = PCANBasic()
except NameError:
pass # replace it whatever you want to do when this error occurs.

其他的东西

关于python - 名称错误 : global name 'windll' is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51322951/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com