BigEndianUnion不是python的ctypes的一部分

时间:2018-03-28 02:03:44

标签: python ctypes

Python文档说here“要构建具有非本地字节顺序的结构,您可以使用BigEndianStructure,LittleEndianStructure,BigEndianUnion和LittleEndianUnion基类之一”

然而:

Python 3.6.1 (default, Jul 13 2017, 21:35:51)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> BigEndianStructure
<class 'ctypes._endian.BigEndianStructure'>
>>> BigEndianUnion
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'BigEndianUnion' is not defined

任何人都知道如何使BigEndianUnion可用(理想情况下也使用python 2.7)?

提前致谢

[更新] p.s.打开https://bugs.python.org/issue33178

0 个答案:

没有答案