Windows Server 2008 还是 Vista?

发布于 2024-07-14 05:39:02 字数 135 浏览 5 评论 0原文

有什么简单(易于实施)的方法可以通过 Python 脚本检查我使用的是 Windows Vista 还是 Windows Server 2008?

platform.uname() 对于两个版本给出相同的结果。

What is an easy (to implement) way to check whether I am on Windows Vista or Windows Server 2008 from a Python script?

platform.uname() gives the same result for both versions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

祁梦 2024-07-21 05:39:02

正如另一个问题中提到的,万无一失的(我认为)方法是使用 win32api.GetVersionEx(1)。 版本号和产品类型的组合将为您提供当前运行的 Windows 平台。 例如。 版本号“6.*”和产品类型 VER_NT_SERVER 的组合是 Windows Server 2008。

您可以在 msdn

As mentioned in the other question the foolproof (I think) way is to use win32api.GetVersionEx(1). The combination of the version number and the product type will give you the current windows platform you're running on. Eg. the combination of version number "6.*" and product type VER_NT_SERVER is Windows Server 2008.

You can find information about the different combinations you can get at msdn

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文