python 判断操作系统以及操作系统版本号

 

>>> import platform
>>> platform.platform()
'Darwin-17.7.0-x86_64-i386-64bit'
>>> platform.system()
'Darwin'


>>> import platform
>>> platform.system()
'Windows'


>>> import platform
>>> platform.system()
'Linux'


参考:
https://www.cnblogs.com/SunshineKimi/p/10890415.html
https://blog.csdn.net/lixianlin/article/details/80866598

 

posted @ 2019-09-17 18:17  anobscureretreat  阅读(1634)  评论(0编辑  收藏  举报