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

Alex Martelli aleax at aleax.it
Sun Mar 2 10:28:32 EST 2003


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.  But then, if you do need to
distinguish, surely you ARE using win32all or the equivalent already?


Alex





More information about the Python-list mailing list