Reliably detect Windows in Python

前端 未结 6 1364
半阙折子戏
半阙折子戏 2020-12-12 21:46

I\'m working on a couple of Linux tools and need to prevent installation on Windows, since it depends on FHS and is thus rendered useless on that platform. The platfor

6条回答
  •  春和景丽
    2020-12-12 22:24

    From help(platform)

    system()
        Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'.
    
        An empty string is returned if the value cannot be determined.
    

提交回复
热议问题