Uname() Method Of Os Module In Python

Method Name:

uname

Method Signature:

os.uname()

Return Value:

Returns a tuple-like instance of type posix.uname_result which contains named attributes and their values.

Method Overview:

  • The method os.uname() returns information on the operating system kernel.
  • The information on the operating system kernel include
    • Name of the operating system
    • Node Name – Implementation defined name of the machine on the network
    • Release – Release number of the Operating System
    • Version – Version number of the Operating System
    • Machine – Hardware Identifier of the machine e.g., x86_64

 

Example:

import os

 

print("System Information:")

print(os.uname())

 

Output:

System Information:

posix.uname_result(sysname='Darwin', nodename='Python-iMac.local', release='14.0.0', version='Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64', machine='x86_64')

 

 

 


Copyright 2023 © pythontic.com