python判断是windows还是linux

1
2
3
4
5
import platform
if 'windows' == platform.system ().lower ():
print ("是windows系统")
elif 'linux' == platform.system ().lower ():
print ("是linux系统")