How to find out operating system

David LeBlanc whisper at oz.net
Thu Jun 27 03:12:43 EDT 2002


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 at python.org
> [mailto:python-list-admin at python.org]On Behalf Of A
> Sent: Wednesday, June 26, 2002 23:25
> To: python-list at python.org; tutor at python.org;
> activepython at listserv.activestate.com; python-help at 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 at 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






More information about the Python-list mailing list