如何使用Python查找系统类型?

如何使用Python查找系统类型?,python,Python,如何使用Python查找系统类型(即32位或64位)…?请参阅平台模块 平台模块提供此类信息。例如: >>> platform.architecture() ('32bit', 'ELF') 更多与体系结构相关的信息可在sys.platform和sys.byteorder32位版本的Python中找到(无论安装在哪个体系结构上): Python的64位版本: >>> import platform >>> platform.architec

如何使用Python查找系统类型(即32位或64位)…?

请参阅平台模块


平台模块提供此类信息。例如:

>>> platform.architecture()
('32bit', 'ELF')
更多与体系结构相关的信息可在
sys.platform
sys.byteorder
32位版本的Python中找到(无论安装在哪个体系结构上):

Python的64位版本:

>>> import platform
>>> platform.architecture()
('64bit', 'WindowsPE')

你指的是操作系统或Python解释器的位吗?事实上,当我运行64位Windows操作系统时,它向我显示了(32位,WindowsPE)…解释器是32位二进制。@Parasaoji:但显然你运行的是32位Python解释器。@Parasaoji:Try
platform.win32\u ver()
获取有关Windows版本的信息。事实上,当我运行64位Windows操作系统时,它会向我显示(32位,WindowsPE…@Parasaoji,但您运行的是64位版本的python吗?
>>> import platform
>>> platform.architecture()
('64bit', 'WindowsPE')