Testing for win95 vs. win98 vs. winNT?

Mark Hammond MHammond at skippinet.com.au
Fri May 7 05:34:57 EDT 1999


David Ascher wrote in message ...
>How can a Python program guess with a stock 1.5.2 (none of those fancy
>shmancy aussie win32 extensions!) whether it's running on win95, win98 or
>winNT?  (In truth, I care only about whether a specific DLL is installed,
>but that correlates with win95 vs. the others).

Well, you did say *guess* :-)

NT has:
>>> os.environ['OS']
'Windows_NT'

And a number of other variables that don't exist on 95/98 by default.  Im
not sure if _all_ NT machines have that variable by default , but I sure
didnt add it to my machine (and it exists on all NT W/S and Servers I have
seen)

Mark.








More information about the Python-list mailing list