Re: Detecting OS platform in Python



On Jan 10, 7:53 pm, Benjamin <musiccomposit...@xxxxxxxxx> wrote:
On Jan 10, 8:37 pm, Devraj <dev...@xxxxxxxxx> 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)


Better yet, first use sys.platform. If that is 'linux2', then use
platform.dist().

/Jean Brouwers


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.

.



Relevant Pages

  • Re: I am getting new PC for office purpose, can I install Linux instead of Windows
    ... If you go with RH then FC4 is the only thing to use at this time AND do yum -yt upgrade as soon as you know it has installed. ... I have participated in this newsgroup when I switch to linux full time about 7 years ago and almost all the questions have been distribution independent so maybe my choice was not for the best reason. ...
    (linux.redhat)
  • Re: masm32
    ... Red Hat was an original distribution, ... > I see many BSDed licenced goods avaliable for Linux. ... > But the licence shouldn't be the exclusive reason to use an OS. ... I don't see a license as a reason to use something, but I do see it as ...
    (comp.lang.asm.x86)
  • Re: Motherboard Question
    ... On Wed, 29 Dec 2004 06:22:37 GMT, Rick Moen wrote: ... >> Is there any reason that you need to use an antique distribution? ... >> download a free version called Whitebox Linux. ... > Linux for no better reason than it being the only RHEL rebuild they've ...
    (comp.os.linux.hardware)
  • Re: Best distribution
    ... > Hi all I am migrating from Windows to Linux. ... Which distribution is ... If there was a "best" choice, then there wouldn't be reason for them ... I have no reason to imagine that any of these are forcibly preferable ...
    (comp.os.linux.x)
  • Re: Why so hard to setup hardware? Control panel?
    ... > Linux is the kernel, that everything else runs on top of. ... Linux people are knife builders and whittlers. ... > these common elements to make up their distribution. ... Depending on the distribution and the hardware platform my results have ...
    (comp.os.linux.setup)