os.uname() method in python is used to get information about current operating system. This method returns information like name, release and version of current operating system, name of machine on network and hardware identifier in the form of attributes of a tuple-like object.
Syntax: os.uname()
Parameters: Not required
Return Type: This method returns a tuple-like object which has 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
Code #1: use of os.uname() method
# Python program to explain os.uname() method # importing os module import os # Get the information of current # operating system os_info = os.uname() # print the information print(os_info) |
posix.uname_result(sysname='Linux', nodename='pppContainer', release='4.4.0-1075-aws', version='#85-Ubuntu SMP Thu Jan 17 17:15:12 UTC 2019', machine='x86_64')
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
Recommended Posts:
- Difference between Method Overloading and Method Overriding in Python
- class method vs static method in Python
- Get() method for dictionaries in Python
- Real-Time Edge Detection using OpenCV in Python | Canny edge detection method
- Python Program to detect the edges of an image using OpenCV | Sobel edge detection method
- Line detection in python with OpenCV | Houghline method
- Python | os._exit() method
- Python | os.WEXITSTATUS() method
- Python | os.abort() method
- Python | os.renames() method
- Python | os.lseek() method
- Python calendar module | formatmonth() method
- Python | PyTorch sin() method
- Python | Sympy Line.is_parallel() method
- Python PIL | GaussianBlur() method
- Python | range() method
- Python | Numpy np.hermefit() method
- Python | Numpy np.hermevander() method
- Python String Title method
- Python groupby method to remove all consecutive duplicates
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

