How Can I Determine the Operating System with Python?

David Eppstein eppstein at ics.uci.edu
Fri Mar 22 00:28:15 EST 2002


In article <slrna9m6sv.4s.gerhard at lilith.my-fqdn.de>,
 Gerhard Häring <gerhard at bigfoot.de> wrote:

> And nmap isn't a standard Unix tool either. On Unix, the only thing you can
> depend on is the presence of "uname", which exactly the right tool for the
> task. Only I don't know of an "uname" equivalent for Windows or Mac.

uname works just fine on Mac OS X.  It returns "Darwin".
Don't know of an equivalent for non-Unix versions of Mac OS, though.

-- 
David Eppstein       UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/



More information about the Python-list mailing list