【问题标题】:Is there any way to know what version of windows is running? [duplicate]有什么方法可以知道正在运行的 Windows 版本是什么? [复制]
【发布时间】:2019-07-27 16:12:38
【问题描述】:

所以在我的程序中,我需要知道程序是在 Windows 7 还是 10 中运行。有没有可以做到这一点的方法或模块?

【问题讨论】:

  • 使用platform 模块。 platform.release() 是你想要的。

标签: python python-3.x


【解决方案1】:
import platform


print("Platform :- "+platform.platform())
print("OS:- "+platform.system())
print("Version:- "+platform.version())
print("release:- "+platform.release())

【讨论】:

    猜你喜欢
    • 2021-01-06
    • 1970-01-01
    • 2010-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-12
    • 2011-10-10
    • 1970-01-01
    相关资源
    最近更新 更多