在Python中检测64位操作系统(Windows)
发布于 2021-01-29 19:35:00
有谁知道我会怎么做才能检测到Windows在Python下的版本。我需要知道这是为Program Files使用正确的文件夹的一种方式。
非常感谢
关注者
0
被浏览
71
1 个回答
-
platform
模块 -访问基础平台的标识数据>>> import platform >>> platform.architecture() ('32bit', 'WindowsPE')
在64位Windows上,32位Python返回:
('32bit', 'WindowsPE')
这意味着 即使已接受此答案,也不正确。 请参阅以下一些答案,以了解可能适用于不同情况的选项。