The function os.uname() returns information identifying the current operating system. The return value is an object with five attributes:
- sysname - operating system name
- nodename - name of machine on network (implementation-defined)
- release - operating system release
- version - operating system version
- machine - hardware identifier
example code: sysinfo.py
import os
uname = os.uname()
print(uname)
print("sysname: " + uname.sysname)
print("nodename: " + uname.nodename)
print("release: " + uname.release)
print("version: " + uname.version)
print("machine: " + uname.machine)
Run on Raspberry Pi
No comments:
Post a Comment