Python | platform.uname() Method Last Updated : 23 Aug, 2022 Comments Improve Suggest changes Like Article Like Report In this article, we will learn how to detect the operating system that is currently being used in your system using Python. Detect OS Using the platform Module in Python The platform.uname() method in python is used to get information about the current operating system. This method returns information like name, release, and version of the current operating system, name of the machine on the network, and hardware identifier in the form of attributes of a tuple-like object. Syntax of platform.uname() Syntax: platform.uname() Return Type: This method returns a tuple-like object which has five attributes: sysname: operating system namenodename: name of the machine on the network (implementation-defined)release: operating system releaseversion: operating system versionmachine: hardware identifierCheck Operating System using platform.uname() method In this method, we are using the uname() method to get OS Python information. Python3 import platform print(platform.uname()) Output: Comment More infoAdvertise with us Next Article Python | platform.uname() Method I ihritik Follow Improve Article Tags : Python python-os-module Practice Tags : python Similar Reads Python | os.ttyname() method OS module in Python provides functions for interacting with the operating system. OS comes under Pythonâs standard utility modules. This module provides a portable way of using operating system dependent functionality. os.ttyname() method in Python is used to get the terminal device associated with 4 min read Python | os.urandom() method OS module in Python provides functions for interacting with the operating system. OS comes under Pythonâs standard utility modules. This module provides a portable way of using operating system dependent functionality. os.urandom() method is used to generate a string of size random bytes suitable fo 1 min read Platform Module in Python Platform module in Python is a built-in library that provides a portable way to access detailed information about the underlying platform (hardware and operating system) on which your Python program is running. This can include data such as the OS name and version, machine type, processor info and P 3 min read Python | os.path.size() method OS module in Python provides functions for interacting with the operating system. OS comes under Pythonâs standard utility modules. This module provides a portable way of using operating system-dependentthe functionality. os.path module is a submodule of the OS module in Python used for common path 2 min read Python | os.stat() method OS comes under Python standard utility modules. This module provides a portable way of using operating system-dependent functionality. os.stat() method in Python performs stat() system calls on the specified path. This method is used to get the status of the specified path. os.stat() Method Syntax i 3 min read Python | os.system() method The OS module in Python provides functions for interacting with the operating system. OS comes under Pythonâs standard utility modules. This module provides a portable way of using operating system-dependent functionality.os.system() method executes the command (a string) in a subshell. This method 3 min read Python | os.sysconf() method OS module in Python provides functions for interacting with the operating system. OS comes under Pythonâs standard utility modules. This module provides a portable way of using operating system dependent functionality. os.sysconf() method in Python is used to get integer-valued system configuration 4 min read Python | os.openpty() method OS module in Python provides functions for interacting with the operating system. OS comes under Pythonâs standard utility modules. This module provides a portable way of using operating system dependent functionality. os.openpty() method in Python is used to open a new pseudo-terminal pair. This me 1 min read Python | os.minor() method OS module in Python provides functions for interacting with the operating system. OS comes under Pythonâs standard utility modules. This module provides a portable way of using operating system dependent functionality. os.minor() method in Python is used to extract the device minor number from the s 2 min read Python | os.pread() method OS module in Python provides functions for interacting with the operating system. OS comes under Pythonâs standard utility modules. This module provides a portable way of using operating system dependent functionality. os.pread() method in Python is used to read at most n bytes from the file associa 3 min read Like