Detecting OS platform in Python

Devraj devraj at gmail.com
Fri Jan 11 03:37:59 CET 2008


Hi everyone,

My Python program needs reliably detect which Operating System its
being run on, infact it even needs to know which distribution of say
Linux its running on. The reason being its a GTK application that
needs to adapt itself to be a Hildon application if run on devices
like the N800.

I have been searching around for an answer to this, and did find some
messages on a lists that suggested the use of sys.platform to detect
platform, with counter posts saying that it didn't work on Windows
etc.

Can anyone please shed some light on this?

Thanks a lot.



More information about the Python-list mailing list