Finding out the OS distribution name (platform.py)

M.-A. Lemburg mal at lemburg.com
Sat Oct 23 04:10:43 EDT 1999


Cliff Crawford wrote:
> 
> Pada Fri, 22 Oct 1999 17:41:31 +0200, M.-A. Lemburg bilang:
> | Thanks. So leaving the check out for FreeBSD is ok. What about other
> | nifty OSes like BeOS, NetBSD, the new BSD-based MacOS (can't remember the
> | name right now) ?
> 
> Mac OS X Server.
> And it is NOT "nifty". :-P

Not ? I thought so... nice GUIs everywhere, real close to Unix, os.fork()
and all that jazz ;-)

> I ran your module on OS X v1.02, here's the output I got:
> 
> -----
> Python 1.5.2 (#1, 07/22/99, 20:33:35)  [GCC Apple DevKit-based CPP 5.0]
> on next5_3
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> >>> import platform
> >>> platform.platform()
> uname: illegal option -- p
> usage: uname [-amnrsv]
> 'Rhapsody-5.5-Power_Macintosh'
> >>> platform.system()
> 'Rhapsody'
> >>> platform.node()
> 'amma'
> >>> platform.release()
> '5.5'
> >>> platform.machine()
> 'Power Macintosh'
> >>> platform.processor()
> ''
> >>> platform.version()
> 'Kernel Release 5.5: Fri Jul  2 13:10:26 PDT 1999;
> root(rcbuilder):Objects/kernel-154.14.obj~10/RELEASE_PPC Copyright (c)
> 1988-1995,1997-1999 Apple Computer, Inc. All Rights Reserved. '
> -----
> 
> What's the -p option to uname supposed to do anyway?  Print the processor
> name?  I think that's what the -m option is for.

Yes, but on some platforms -p gives the (real) processor name, not just
some common alias or processor group like -m does. I'll fix the
module to redirect stderr output to /dev/null.

Note that I did not see the OS name or version anywhere in the
output (something like Mac OS X Server 1.02). Is Rhapsody the
code name for MacOS X Server ?

> Btw, Python compiles right out of the box on OS X Server.  It's one of the
> few un*x packages that I use that I DIDN'T have to patch.  Thanks, Guido! :)

Cool. Do all the tests run through fine ? Would be nice to add Mac OS X
Server to the list of supported platforms for my apps :-)

Thanks for the feedback,
-- 
Marc-Andre Lemburg
______________________________________________________________________
Y2000:                                                    69 days left
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/





More information about the Python-list mailing list