Skip to content

Instantly share code, notes, and snippets.

@somada141
Last active August 29, 2015 14:15
Show Gist options
  • Save somada141/506ac8a5efe8c2730a03 to your computer and use it in GitHub Desktop.
Save somada141/506ac8a5efe8c2730a03 to your computer and use it in GitHub Desktop.
Retrieving system info using Python the 'platform' package #python #system

Using the platform package one can retrieve a lot of information on the running system.

In order to retrieve a detailed string on the platform one can use:

import platform
platform.platform()

and will get a response like this:

'Linux-3.3.0-8.fc16.x86_64-x86_64-with-fedora-16-Verne'

while other useful methods are:

>>> platform.system()
'Windows'
>>> platform.release()
'XP'
>>> platform.version()
'5.1.2600'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment