Created
January 23, 2013 09:34
-
-
Save itkovian/4603654 to your computer and use it in GitHub Desktop.
Python platform checks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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