PyMOTW: platform

Although Python is often used as a cross-platform language, it is occasionally necessary to know what sort of system you’re running on. Build tools obviously need that information, but you might also know that some libraries or external commands have different interfaces on different operating systems. For example, if you are writing a tool to manage the network configuration of an operating system, you can have a portable representation of network interfaces, aliases, IP addresses, etc. But once you get down to actually editing the configuration files, you need to know more about your host and how it is configured. The platform module gives you some tools for learning about the interpreter, operating system, and hardware platform where your program is running.

Read more at platform