Skip to content

Instantly share code, notes, and snippets.

@olooney
Created May 22, 2018 20:47
Show Gist options
  • Save olooney/65682bac02c7b0241570fd2ec0c7d2ac to your computer and use it in GitHub Desktop.
Save olooney/65682bac02c7b0241570fd2ec0c7d2ac to your computer and use it in GitHub Desktop.
use python's 2.7+ platform package to quickly and consistently characterize an enviroment
import platform
print("architecture = {!r}".format(platform.architecture()))
print("machine = {!r}".format(platform.machine()))
print("node = {!r}".format(platform.node()))
print("platform = {!r}".format(platform.platform()))
print("processor = {!r}".format(platform.processor()))
print("python_build = {!r}".format(platform.python_build()))
print("python_compiler = {!r}".format(platform.python_compiler()))
print("python_branch = {!r}".format(platform.python_branch()))
print("python_implementation = {!r}".format(platform.python_implementation()))
#print("python_revision = {!r}".format(platform.python_revision()))
print("python_version = {!r}".format(platform.python_version()))
print("python_version_tuple = {!r}".format(platform.python_version_tuple()))
print("release = {!r}".format(platform.release()))
print("system = {!r}".format(platform.system()))
#print("system_alias = {!r}".format(platform.system_alias()))
print("version = {!r}".format(platform.version()))
print("uname = {!r}".format(platform.uname()))
print("java_ver = {!r}".format(platform.java_ver()))
print("win32_ver = {!r}".format(platform.win32_ver()))
#print("popen = {!r}".format(platform.popen()))
print("mac_ver = {!r}".format(platform.mac_ver()))
print("dist = {!r}".format(platform.dist()))
print("linux_distribution = {!r}".format(platform.linux_distribution()))
print("libc_ver = {!r}".format(platform.libc_ver()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment