On 23 Jan 2013, at 08:31, Stijn De Weirdt <[email protected]> wrote:
> import platform
> print platform.dist()
>
> it is in 2.3.
>
> on my fc17, it gives
>
> dist(distname='', version='', id='', supported_dists=('SuSE', 'debian',
> 'fedora', 'redhat', 'centos', 'mandrake', 'mandriva', 'rocks', 'slackware',
> 'yellowdog', 'gentoo', 'UnitedLinux', 'turbolinux'))
> Tries to determine the name of the Linux OS distribution name.
>
> The function first looks for a distribution release file in
> /etc and then reverts to _dist_try_harder() in case no
> suitable files are found.
>
> Returns a tuple (distname,version,id) which default to the
> args given as parameters.
>
>
> so no ubuntu ? (or is that debian)
>
> maybe people should try it and send back the output for different OSes?
Ahem.
zorsair:~/work/hpc/repos/vsc-ldap $ python
Python 2.7.2 (default, Jun 20 2012, 16:23:33)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> print platform.dist()
('', '', '')
In [18]: platform.system()
Out[18]: 'Darwin'
In [19]: platform.mac_ver()
Out[19]: ('10.8.2', ('', '', ''), 'x86_64')
In [20]: platform.machine()
Out[20]: 'x86_64'
In [23]: platform.platform()
Out[23]: 'Darwin-12.2.1-x86_64-i386-64bit'
In [24]: platform.uname()
Out[24]:
('Darwin',
'b245h132.ugent.be',
'12.2.1',
'Darwin Kernel Version 12.2.1: Thu Oct 18 16:32:48 PDT 2012;
root:xnu-2050.20.9~2/RELEASE_X86_64',
'x86_64',
'i386')
In [25]: platform.version()
Out[25]: 'Darwin Kernel Version 12.2.1: Thu Oct 18 16:32:48 PDT 2012;
root:xnu-2050.20.9~2/RELEASE_X86_64'
In [26]: platform.mac_ver()
Out[26]: ('10.8.2', ('', '', ''), 'x86_64')
Regards,
-- Andy