Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Python platform checks
#!/usr/bin/python
import platform
import sys
def linux_distribution():
try:
return platform.linux_distribution()
except:
return "N/A"
print """Python version: %s
dist: %s
linux_distrubution: %s
system: %s
machine: %s
platform: %s
uname: %s
version: %s
mac_ver: %s
""" % (
sys.version.split('\n'),
str(platform.dist()),
linux_distribution(),
platform.system(),
platform.machine(),
platform.platform(),
platform.uname(),
platform.version(),
platform.mac_ver(),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.