python每日学习01

platform库,跨平台时可以判断当前系统

import platform
def testPlatfrom():
    platform_system = platform.system()
    print(platform_system)
    #跨平台可以用
    OS_MAC = (platform_system == 'Darwin')
    OS_WIN = (platform_system == 'Windows')
    OS_LINUX = (platform_system == 'Linux')

if __name__ == '__main__':
     testPlatfrom()
    原文作者:Symbian米汤
    原文地址: https://www.jianshu.com/p/535ca683a35d
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞