判断操作系统

判断系统是Windown还是liunx

import sys , platform
print(sys.platform)
print(platform.system())

在Windown上执行结果

win32
Windows

在ubuntu上执行结果

linux
Linux

你可能感兴趣的:(判断操作系统)