gpt4 book ai didi

python - Windows Server 2008 还是 Vista?

转载 作者:行者123 更新时间:2023-12-01 06:20:03 25 4
gpt4 key购买 nike

通过 Python 脚本检查我使用的是 Windows Vista 还是 Windows Server 2008 的简单(实现)方法是什么?

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

最佳答案

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

您可以在 msdn 找到有关不同组合的信息。

关于python - Windows Server 2008 还是 Vista?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/553372/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com