import platform OS = platform.system() # Windows, Linux, Darwin def get_sys(): if OS == 'Darwin': print('Darwin') elif OS == 'Linux': print('Linux') elif OS =='Windows': print('Windows') else: print(OS) get_sys()
import platform OS = platform.system() # Windows, Linux, Darwin def get_sys(): if OS == 'Darwin': print('Darwin') elif OS == 'Linux': print('Linux') elif OS =='Windows': print('Windows') else: print(OS) get_sys()
转载于:https://www.cnblogs.com/yanxiatingyu/p/10374074.html