gpt4 book ai didi

python - 导入 ctypes.wintypes 时出错

转载 作者:IT王子 更新时间:2023-10-29 01:19:18 28 4
gpt4 key购买 nike

当我尝试导入 ctypes.wintypes 时出现此错误,我该如何解决?

In [2]: import ctypes.wintypes
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-2-8395760a4e8a> in <module>()
----> 1 import ctypes.wintypes

/usr/lib/python2.7/ctypes/wintypes.py in <module>()
21
22 from ctypes import _SimpleCData
---> 23 class VARIANT_BOOL(_SimpleCData):
24 _type_ = "v"
25 def __repr__(self):

ValueError: _type_ 'v' not supported

最佳答案

您只能在 Windows 中导入 ctypes.wintypes。 (ctypes.wintypes 包含特定于 Windows 的数据类型。)

window :

>>> import ctypes.wintypes
>>>

Linux:

>>> import ctypes.wintypes
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/ctypes/wintypes.py", line 23, in <module>
class VARIANT_BOOL(_SimpleCData):
ValueError: _type_ 'v' not supported
>>>

关于python - 导入 ctypes.wintypes 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20897842/

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