How to find out operating system

David LeBlanc whisper at oz.net
Thu Jun 27 15:02:45 EDT 2002


> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of Syver Enstad
> Sent: Thursday, June 27, 2002 11:18
> To: python-list at python.org
> Subject: Re: How to find out operating system
> 
> 
> Peter Hansen <peter at engcorp.com> writes:
> 
> > 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
> 
> -- 
> 
> Vennlig hilsen 
> 
> Syver Enstad
> -- 

C:\>python
Python 2.2.1 (#34, Apr  9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ.has_key('WINOS')
1
>>> os.environ['WINOS']
'WIN2000'
>>>





More information about the Python-list mailing list