Anyway, I think os.name is the easiest way to distinguish windows / non-windows... according to the docs, it's guaranteed to be one of only a few set values. Of course, i don't think it distinguishes between darwin and linux, but you can then use platform.system() for that.
Also, I just realized... I was just copy and pasting your earlier code, which, upon closer inspection, doesn't print "no uname" if uname fails... so it looks like, for all the previous tests I posted, uname actually DOESN'T exist. Sorry about that. - Paul On Thu, Jul 9, 2009 at 11:20 AM, Paul Molodowitch<[email protected]> wrote: > there's also os.name... > > - Paul > > On Thu, Jul 9, 2009 at 11:04 AM, chadrik<[email protected]> wrote: >> this is kind of ridiculous. for our purposes, we really only need to know >> if it's osx, linux, or windows, so i'm solving it like this: >> try: >> SYSTEM = platform.system() >> # Note: for XP x64 and Vista, system() returns 'Microsoft'. >> if SYSTEM not in ('Darwin', 'Linux'): >> SYSTEM = 'Windows' >> except: >> # There are also cases where platform.system fails completely on Vista >> SYSTEM = 'Windows' >> >> >> -chad >> >> >> >> >> On Jul 9, 2009, at 10:38 AM, Paul Molodowitch wrote: >> >> os.rename failed on dave's test on Vista32. it looks like it might be >> >> a vista problem, because the origin bug was posted from a vista64 user. >> >> Odd - os.uname worked fine on the vista 64 machines I tested... >> >> - Paul >> >> >> >> >> >> >> >> > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/python_inside_maya -~----------~----~----~----~------~----~------~--~---
