Get the name of my computer OS in Python

You can get the name of your computer OS in Python.

import sys

p = sys.platform

print(p)  # darwin

The platform name of MacOS is darwin.

Comments

Powered by Markdown

More