Detecting OS platform in Python

Benjamin musiccomposition at gmail.com
Thu Jan 10 22:53:18 EST 2008


On Jan 10, 8:37 pm, Devraj <dev... at gmail.com> wrote:
> 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.
platform.dist might help you. It's not very complete at all, though.
(This is supposed to improve in 2.6, though)
>
> 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