Python | os.uname() method
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')
Recommended Posts:
- class method vs static method in Python
- Python | next() method
- Python | set() method
- Python | os.dup() method
- Python | shutil.which() method
- Python | PyTorch sin() method
- Python | os.sched_getaffinity() method
- Python | os.sched_setaffinity() method
- Python | os.sched_get_priority_min() method
- Python | os.kill() method
- Python | os.minor() method
- Python | os.renames() method
- Python | sympy.apart() method
- Python | os.getcwd() method
- Python | os.ftruncate() method
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.




