Python---判断当前的操作系统

# -*- coding:utf-8 -*-
import platform

os_name = platform.system()
if os_name == 'Windows':
    print "Windows system!!!"
elif os_name == 'Linux':
    print "Linux system!!!"
else:
    print "other system!!!"

参考:https://blog.csdn.net/xc_zhou/article/details/80952181
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章