[Python] detect which OS is it running under?

>>> import platform
>>> platform.system()
'Linux'

The output of platform.system() is as follows:

  • Linux: Linux
  • Mac: Darwin
  • Windows: Windows

See: platform — Access to underlying platform’s identifying data
https://docs.python.org/2/library/platform.html

相關文章

寫留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *