import platform
def isWondows():
'''
判断当前运行平台
:return:
'''
sysstr = platform.system()
if (sysstr == "Windows"):
return True
elif (sysstr == "Linux"):
return False
else:
print ("Other System ")
return False
python 判断当前是Windows还是Linux平台
最新推荐文章于 2024-03-09 04:22:48 发布
本文介绍了一个Python函数,用于判断当前代码是在Windows还是Linux环境下运行。通过调用platform模块的system()方法,该函数返回True(Windows)或False(Linux),对于其他系统则输出警告并返回False。
72

被折叠的 条评论
为什么被折叠?



