Skip to content

Instantly share code, notes, and snippets.

@bron84
Created June 15, 2016 05:29
Show Gist options
  • Select an option

  • Save bron84/b5a2b0cba4279f5d770f6e85bd2957b0 to your computer and use it in GitHub Desktop.

Select an option

Save bron84/b5a2b0cba4279f5d770f6e85bd2957b0 to your computer and use it in GitHub Desktop.
platform_info_mod.py
import inspect, platform
for name, value in inspect.getmembers(platform):
if name[0] != '_' and callable(value):
try:
value = value()
except (IndexError, TypeError):
continue
if str(value).strip("( ,')"):
print('{:>21}() = {}'.format(name, value))
import sys
print(sys.platform, sys.version)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment