Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def comp_info():
- """Return information for the computer and python version
- comp_info() # to use...
- """
- import platform
- winv = platform.platform()
- py_ver = platform.python_version()
- plat = platform.architecture()
- proc = platform.processor()
- p_node = platform._node()
- u_name = platform.uname()
- ud = u_name._asdict()
- udl = list(zip(ud.keys(), ud.values()))
- frmt = """
- ---------------------------
- Computer/python information
- Platform: {}
- python version: {}
- windows version: {}
- processor: {}
- node: {}
- user/machine: {}\n
- Alternate form...."""
- args = [winv, py_ver,plat, proc, p_node, u_name]
- print(dedent(frmt).format(*args))
- print("\n".join(["{:<10}: {}".format(*i) for i in udl]))
Add Comment
Please, Sign In to add comment