检测64位操作系统(Windows)在Python [英] Detect 64bit OS (windows) in Python
本文介绍了检测64位操作系统(Windows)在Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有谁知道我怎么会去检测什么位版本的Windows是Python的下。我需要知道这是用正确的文件夹,程序文件的方式。
Does anyone know how I would go about detected what bit version Windows is under Python. I need to know this as a way of using the right folder for Program Files.
感谢
推荐答案
平台
模块 - 访问底层平台的识别数据
platform
module -- Access to underlying platform’s identifying data
>>> import platform
>>> platform.architecture()
('32bit', 'WindowsPE')
在64位Windows,32位Python的回报:
On 64-bit Windows, 32-bit Python returns:
('32bit', 'WindowsPE')
这意味着这个答案,尽管它已被接受,是不正确。请参阅下面的一些问题的答案,选择那些工作于不同的情况选择。
And that means that this answer, even though it has been accepted, is incorrect. Please see some of the answers below for options that may work for different situations.
这篇关于检测64位操作系统(Windows)在Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文