getting linux distro used...

Discussion in 'Python' started by deostroll, Apr 27, 2009.

  1. deostroll

    deostroll Guest

    Hi,

    I just found that you could use platform.system() to get the
    underlying os used. But is there a way to get the distro used...?

    --deostroll
    deostroll, Apr 27, 2009
    #1
    1. Advertising

  2. deostroll

    David Lyon Guest

    perphaps platform.uname()?

    On Sun, 26 Apr 2009 22:35:29 -0700 (PDT), deostroll <>
    wrote:
    > Hi,
    >
    > I just found that you could use platform.system() to get the
    > underlying os used. But is there a way to get the distro used...?
    >
    > --deostroll
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    David Lyon, Apr 27, 2009
    #2
    1. Advertising

  3. In message <c7c38f62-1929-46da-
    >, deostroll wrote:

    > I just found that you could use platform.system() to get the
    > underlying os used. But is there a way to get the distro used...?


    Mostly the differences will not be important. But if you want to know, I
    have been compiling a list of tests here
    <http://codecodex.com/wiki/index.php?title=Identifying_the_OS_Distribution>.
    Lawrence D'Oliveiro, Apr 27, 2009
    #3
  4. deostroll

    r-w Guest

    deostroll wrote:
    > Hi,
    >
    > I just found that you could use platform.system() to get the
    > underlying os used. But is there a way to get the distro used...?
    >
    > --deostroll


    platform.dist() returns
    ('debian', 'lenny/sid', '')
    on my Ubuntu box.

    Ross
    r-w, Apr 27, 2009
    #4
  5. In message <gt4114$e3l$>, Sebastian Wiesner wrote:

    > <Lawrence D'Oliveiro – Montag, 27. April 2009 10:07>
    >
    >> <http://codecodex.com/wiki/index.php?title=Identifying_the_OS_Distribution>.

    >
    > At least the Gentoo-Test is not very reliable.


    It's a wiki. You know what to do.
    Lawrence D'Oliveiro, Apr 27, 2009
    #5
  6. deostroll

    JanC Guest

    deostroll wrote:

    > I just found that you could use platform.system() to get the
    > underlying os used. But is there a way to get the distro used...?


    Major modern distros support 'lsb_release', I suppose:

    $ lsb_release -i -r -c -d
    Distributor ID: Ubuntu
    Description: Ubuntu 9.04
    Release: 9.04
    Codename: jaunty


    If that doesn't work; try '/etc/issue'.


    --
    JanC
    JanC, Apr 30, 2009
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. azrael

    python linux distro

    azrael, Feb 8, 2007, in forum: Python
    Replies:
    10
    Views:
    661
    Szabolcs Nagy
    Feb 10, 2007
  2. member thudfoo
    Replies:
    0
    Views:
    283
    member thudfoo
    Jan 5, 2009
  3. Guest
    Replies:
    0
    Views:
    468
    Guest
    Jan 6, 2009
  4. steveh44
    Replies:
    0
    Views:
    676
    steveh44
    Sep 15, 2011
  5. Hal Fulton

    Ruby-oriented Linux distro?

    Hal Fulton, Oct 22, 2003, in forum: Ruby
    Replies:
    27
    Views:
    371
    gabriele renzi
    Oct 24, 2003
Loading...

Share This Page