thanks dave. for others, here's something slightly easier to run
import os try: print os.uname() except: "no uname" import sys print sys.platform try:import win32con except ImportError: print "no win32con" -chad On Jul 8, 2009, at 1:37 PM, [email protected] wrote: > > Hi Chad, > > Just opened wing on my Vista 32bit PC and ran the following code in > the python shell > > Hope that gives you a better clue. Better fly as dinners on the > table :) > > -Dave > > Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit > (Intel)] > Type "help", "copyright", "credits" or "license" for more information. >>>> import os >>>> os.uname() > Traceback (most recent call last): > File "<string>", line 1, in <string> > AttributeError: 'module' object has no attribute 'uname' >>>> import sys >>>> print sys.platform > win32 >>>> win32_ver() > Traceback (most recent call last): > File "<string>", line 1, in <string> > NameError: name 'win32_ver' is not defined >>>> > > On Jul 8, 8:00 pm, Chadrik <[email protected]> wrote: >> i just got a bug for pymel related to calling platform.system() >> running Maya 2008 Ext 2 32-bit running on Vista 64 bit. the error >> is : >> >> # SYSTEM = platform.system() >> # File "C:\Program Files (x86)\Autodesk\Maya2008\bin\python25.zip >> \platform.py", line 1042, in system >> # return uname()[0] >> # File "C:\Program Files (x86)\Autodesk\Maya2008\bin\python25.zip >> \platform.py", line 960, in uname >> # release,version,csd,ptype = win32_ver() >> # File "C:\Program Files (x86)\Autodesk\Maya2008\bin\python25.zip >> \platform.py", line 479, in win32_ver >> # from win32con import HKEY_LOCAL_MACHINE,VER_PLATFORM_WIN32_NT,\ >> # ImportError: No module named win32con # >> >> can any of you windows folks help me out on this? how can i safely >> get >> the system on windows, and why has this not been a problem for other >> windows users? >> >> i'd be very interested to know what these lines return on windows xp >> 32/64 and vista 32/64 under 2008x32, 2008x64, 2009x32, 2009x64: >> >> import os, sys >> print os.uname() >> print sys.platform >> import win32con >> >> here's why i'm interested in these values. this is some code from >> platform.py on 2008: >> >> # Get some infos from the builtin os.uname API... >> try: >> system,node,release,version,machine = os.uname() >> >> except AttributeError: >> # Hmm, no uname... we'll have to poke around the system then. >> system = sys.platform >> release = '' >> version = '' >> node = _node() >> machine = '' >> processor = '' >> use_syscmd_ver = 1 >> >> # Try win32_ver() on win32 platforms >> if system == 'win32': >> release,version,csd,ptype = win32_ver() # <--imports >> win32con >> >> i'm thinking that usually os.uname() succeeds on windows, but in this >> case it's failing and resulting in the import of win32con. >> >> -chad > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/python_inside_maya -~----------~----~----~----~------~----~------~--~---
