2024-09-28 01:23:48 发布
网友
有没有什么Python式的方法来确定操作系统的分布/风格?在
cat/etc/issue显示了以下内容--[its CentOS 5.6]
[root@localhost Abhishek]# cat /etc/issue CentOS release 5.6 (Final) Kernel \r on an \m
使用sys.platform()获取平台。 或使用platform.platform()获取更多详细信息
sys.platform()
>>> import platform >>> print platform.linux_distribution() ('Ubuntu', '12.04', 'precise')
注意:^{}从python3.5开始就被弃用,并将在python3.7中被删除。在
使用
sys.platform()
获取平台。 或使用platform.platform()获取更多详细信息注意:^{} 从python3.5开始就被弃用,并将在python3.7中被删除。在
相关问题 更多 >
编程相关推荐