[MMTK] running MMTK test script on windows XP

Peter MMTK at maubp.freeserve.co.uk
Fri Mar 31 22:50:34 CEST 2006


konrad.hinsen at laposte.net wrote:
> However, piecing together all the feedback I have received, my  
> conclusion is that xMoldyn does not work with the standard Python for  
> Windows, because it uses the module "pwd" which is not provided for  
> Windows. I have had reports about xMoldyn use on Windows, but  
> probably this was under Cygwin, whose Python installation is more  
> Unix-like than WIndows-like. However, these are mostly guesses, since  
> I do not have a Windows machine.
> 
> Could any Windows user out there please test the following one-line  
> script both under Python for Windows and under Python in Cygwin?
> 
> 	import pwd
> 
> I would like to know if this yields an error message or just nothing.

I don't have a cygwin version of Python installed, but using Python 
2.3.3 on Windows XP SP2, this gives a simple ImportError: No module 
named pwd:-

Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import pwd
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
ImportError: No module named pwd

> BTW, xMoldyn uses pwd to obtain information about the user account  
> under which it is run, in order to prevent confusion when several  
> users are starting background jobs (pMoldyn jobs) on the same  
> machine. Is there perhaps another way to do this under Windows?

Would win32api.GetUserName() be enough? It returns a string.

This uses Mark Hammond's "Python for Windows Extensions" which are 
already a requirement for MMTK on windows.

Peter




More information about the mmtk mailing list