There is a platform module in Python to obtain information about the operating system.
Import platform
Platform. machine () # Returns the machine type, e.g. 'i386'
Platform. node () # Returns the computer's network name
Platform. platform (aliased = 0, terse = 0) # Returns a single string identifying the underlying platform
Platform. processor () # Returns the (true) processor name
Platform. python_branch () # Returns a string identifying the Python implementation branch.
Platform. python_build () # Returns a tuple (buildno, builddate) stating the Python build number and date as strings.
Platform. python_compiler () # Returns a string identifying the compiler used for compiling Python.
Platform. python_version () # Returns the Python version as string 'major. minor. patchlevel'
Platform. release () # Returns the system's release, e.g. '2. 2.0 'or 'nt'
Platform. system () # Returns the system/OS name, e.g. 'linux ', 'windows' or 'java '.
Platform. uname () # Fairly portable uname interface. Returns a tuple of strings (system, node, release, version, machine, processor) identifying the underlying platform.
Platform. win32_ver (release = '', version ='', csd = '', ptype ='') # Get additional version information from the Windows Registry and return a tuple (version, csd, ptype) referring to version number, CSD level and OS type (multi/single processor ).