Couple of noobish question

Tim Rowe digitig at gmail.com
Wed Feb 4 19:14:22 EST 2009


2009/2/4 Bruno Desthuilliers <bdesth.quelquechose at free.quelquepart.fr>:

> # somemodule.py
>
> import os
>
> if os.uname()[0] == "Linux":

On an MS Windows system, os.uname()[0] raises an AttributeError -- sys
doesn't seem to contain uname. Is that a Linux thing? Would os.name
work on Linux? Or would one have to use exception handling and catch
the Windows case?

That's the trouble with using anything in os, of course -- it's os
dependent, which is why it's there! :-)

-- 
Tim Rowe



More information about the Python-list mailing list