[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

相關文章

寫留言

你的電子郵件位址並不會被公開。 必要欄位標記為 *