Skip to content
KerwinKoo edited this page Dec 28, 2015 · 1 revision

python 获取当前系统名称

import platform

def UsePlatform():
  sysstr = platform.system()
  if(sysstr =="Windows"):
    print ("Call Windows tasks")
  elif(sysstr == "Linux"):
    print ("Call Linux tasks")
  else:
    print ("Other System tasks")
    
UsePlatform()

[[TOC]]

Clone this wiki locally