import platform
# 获取当前操作系统的名称
os_name = platform.system()
if os_name == 'Windows':
print("当前操作系统是 Windows")
elif os_name == 'Linux':
print("当前操作系统是 Linux")
else:
print("当前操作系统是 {os_name}")
如何查询当前电脑或虚拟环境的操作系统
最新推荐文章于 2025-01-12 18:46:34 发布