[Tutor] RE: How to find out operating system

David LeBlanc whisper@oz.net
Thu, 27 Jun 2002 00:12:43 -0700


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

os.environ.has_key('WINOS') will tell you that. However, MS os's are so
stupid that there must be some env variable to tell themselves what they
are.

David LeBlanc
Seattle, WA USA

> -----Original Message-----
> From: python-list-admin@python.org
> [mailto:python-list-admin@python.org]On Behalf Of A
> Sent: Wednesday, June 26, 2002 23:25
> To: python-list@python.org; tutor@python.org;
> activepython@listserv.activestate.com; python-help@python.org
> Subject: How to find out operating system
>
>
> Hi,
> What is the best way of  finding out the kind operating system?
> I can use os.name but if the system is Windows I would like also
> know if the system is Windows98 or Windows ME or W2K or
> Windows XP.
> Thanks for help.
> Ladislav
>
>
> _______________________________________________
> ActivePython mailing list
> ActivePython@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> Other options:
> http://listserv.ActiveState.com/mailman/listinfo/ActivePython
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list