identifying operating system

Matthew Schinckel matt at null.net
Fri Jun 16 21:24:24 EDT 2000


Juerg Tschirren <jtschirr at engineering.uiowa.edu> wrote:
> Is there a way how I can identify the operating system my Python
> script is running on (e.g., Linux, Windows, Mac, ...)?
> 
> Juerg

If it is only for compatibilty reasons, you can use os.name.

This will give you one of: ['posix', 'nt', 'dos', 'mac', 'os2', 'ce'].

Matt.



More information about the Python-list mailing list