Couple of noobish question

afriere at yahoo.co.uk afriere at yahoo.co.uk
Wed Feb 4 19:31:24 EST 2009


On Feb 5, 11:14 am, Tim Rowe <digi... at gmail.com> wrote:

...

> 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?

It seems to be a Windows thing.  My Linux box gives me 'Linux' the
server gives me 'SunOS' and a Mac tells me 'Darwin'.  I'm still
running Python2.4 on the Windows box.  At least in that version on the
OS,  the 'os' module has no attribute 'uname',  On both Linux and
SunOS, os.name returns 'posix'.




More information about the Python-list mailing list