How to find out operating system

David LeBlanc whisper at oz.net
Thu Jun 27 19:19:51 EDT 2002


> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of Fredrik Lundh
> Sent: Thursday, June 27, 2002 14:48
> To: python-list at python.org
> Subject: Re: How to find out operating system
> 
> 
> David LeBlanc wrote
> 
> > > > > You might try os.environ:
> > > > > os.environ['WINOS'] -> WIN2000
> > > > >
> > > > > I don't know if WINOS is defined on '98 or ME, but
> > > > > it should be good for NT, 2K and XP
> > > >
> > > > It is not.
> > >
> > > Neither is it defined on win2k pro:
> > > KeyError: WINOS
> 
> > >>> import os
> > >>> os.environ['WINOS']
> > 'WIN2000'
> 
> on the other hand:
> 
> c:\> ver
> Microsoft Windows 2000 [Version 5.00.2195]
> 
> (swedish version, all available service packs and
> security patches)
> 
> c:\> python
> Python 2.1.1 (#20, Aug 23 2001, 11:27:17) [MSC 32 bit (Intel)] on win32
> Type "copyright", "credits" or "license" for more information.
> >>> import os
> >>> os.environ["WINOS"]
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "C:\py21\Lib\os.py", line 372, in __getitem__
>     return self.data[key.upper()]
> KeyError: WINOS
> 
> (fwiw, googling for WINOS brought up a whole bunch of
> pages telling me that if I want to build mozilla, I need to
> set the WINOS variable.  are you sure your computer
> doesn't spend the nights building browsers, when you're
> not looking?)
> 
> </F>

Ewps... I have been known to compile the lizard of browsers

David LeBlanc
Seattle, WA USA 






More information about the Python-list mailing list