sys.platform documentation?
Michiel Sikma
michiel at thingmajig.org
Thu Aug 10 08:00:16 EDT 2006
Op 10-aug-2006, om 13:00 heeft Tim Golden het volgende geschreven:
> Michiel Sikma wrote:
>> Hello everybody,
>>
>> I was thinking about making a really insignificant addition to an
>> online system that I'm making using Python: namely, I would like it
>> to print the platform that it is running on in a human-readable
>> manner. I was thinking of doing it like this:
>
> [... snip ...]
>
>> However, in order to populate the list of platforms, I need to know
>> which strings sys.platform can return. I haven't found any
>> documentation on this
>
> Not that this answers your question directly, but is the
> platform module of any more use to you?
>
> http://docs.python.org/lib/module-platform.html
>
> TJG
>
> --
> http://mail.python.org/mailman/listinfo/python-list
I didn't even know there was a platform module. Too bad that one also
does not have documentation on possible values for common systems.
It seems that uname() is the most resourceful function. So if I do this:
>>> import platform
>>> platform.uname()
('Darwin', 'imac-g5-van-michiel-sikma.local', '8.6.0', 'Darwin Kernel
Version 8.6.0: Tue Mar 7 16:58:48 PST 2006; root:xnu-792.6.70.obj~1/
RELEASE_PPC', 'Power Macintosh', 'powerpc')
That's on Mac OS X 10.4.6. Indeed more useful.
Michiel
More information about the Python-list
mailing list