通过platform模块可以获取系统信息

1
2
3
4
5
6
7
8
# 判定系统
is_sys = platform.system()
if is_sys == "Darwin":
pass
elif is_sys == "Linux":
pass
else:
None