Is the OS win9x or winnt? How to detect it?

Gerhard Häring gh at ghaering.de
Sun Mar 2 11:06:52 EST 2003


Alex Martelli wrote:
> Chen wrote:
> 
>> Is it possible to detect whether the OS is win9x or winnt?
>> 
>> I used os.name but it returns "winnt" even on win98se. While sys.platform
>> returns "win32".
> 
> Hmmm, I think you need win32all (or calldll, etc) for that - I can't
> think of any test you could perform with the stuff that comes with
> the Python standard distribution that reliably puts 95, 98 and ME on
> one side, NT, 2000 and XP on the other. [...]

Alex, I think it should be possible with the _winreg module in the
standard install.

Chen, I'd recommend you use MAL's platform.py for this:

http://www.egenix.com/files/python/Introduction.html

Gerhard
-- 
mail:   gh at ghaering.de
web:    http://ghaering.de/




More information about the Python-list mailing list