Get Hardware and System Information Using Python




#Make sure the platform module is already installed.
#If not then do it...
#----------->pip install platform
#For Linux use pip3


import platform
import os

my_pc = platform.uname()


print(f"Operating System------>{my_pc.system}")
print(f"Node Name------------->{my_pc.node}")
print(f"Release--------------->{my_pc.release}")
print(f"Version of OS--------->{my_pc.version}")
print(f"Machine Details------->{my_pc.machine}")
print(f"Processor Type-------->{my_pc.processor}")
print(f"Architecture---------->{platform.architecture()}")
print("\n")


#-----------------In One Line-------------------
print(os.uname())

Comments