[Tutor] os.name on Windows 98

Magnus Lyckå magnus@thinkware.se
Thu Jul 10 18:59:01 2003


At 19:14 2003-07-09 -0700, Tony Cappellini wrote:
>Why does os.name return 'nt' on a Windows 98 machine ?

Read The Fine Manual:

"os.name
   The name of the operating system dependant module imported..."

If its any consolation, it returns 'posix' on all Unix-like
operating system, regardless of whether it's Linux, AIX or
whatever...

You can also use sys.platform, and on Linux that says 'linux2',
which is a lot more detail, but on Win2k it says 'win32' and
I guess is says the same on win98. Otherwise, that is really
what you should use to figure out what kind of computer you
are running on.

This is a bit of a shortcoming, since not all things work
the same way on Win98 and the NT-derived operating systems.

Why does your program need to know this?


--
Magnus Lycka (It's really Lyckå), magnus@thinkware.se
Thinkware AB, Sweden, www.thinkware.se
I code Python ~ The Agile Programming Language