Guest User

Untitled

a guest
Aug 15th, 2018
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. def comp_info():
  2. """Return information for the computer and python version
  3. comp_info() # to use...
  4. """
  5. import platform
  6. winv = platform.platform()
  7. py_ver = platform.python_version()
  8. plat = platform.architecture()
  9. proc = platform.processor()
  10. p_node = platform._node()
  11. u_name = platform.uname()
  12. ud = u_name._asdict()
  13. udl = list(zip(ud.keys(), ud.values()))
  14. frmt = """
  15. ---------------------------
  16. Computer/python information
  17.  
  18. Platform: {}
  19. python version: {}
  20. windows version: {}
  21. processor: {}
  22. node: {}
  23. user/machine: {}\n
  24. Alternate form...."""
  25. args = [winv, py_ver,plat, proc, p_node, u_name]
  26. print(dedent(frmt).format(*args))
  27. print("\n".join(["{:<10}: {}".format(*i) for i in udl]))
Add Comment
Please, Sign In to add comment