[PythonCE] Minor update for PythonCE2.2+ HPC2000

Telion telionce@yahoo.com
Tue, 15 Oct 2002 10:30:07 -0700 (PDT)


--- Carl Shimer <carl@orangeimagineering.com> wrote:
> 
> In order to properly simulate os.system() you simply need to add a
> WaitForSingleProcess(handle) after createProcess.
> 
> if(CreateProcess(
> 	wideexecName,  // name of executable module,not necessary
> 	wideargs, 	   // command line string
> 	NULL,	         // SID
> 	NULL,          // SID
> 	FALSE,         // handle inheritance option
> 	0,             // creation flags
> 	NULL,	         // environment
> 	NULL,	         // lpCurrentDirectory
> 	#ifndef UNDER_CE
> 	&startInfo,			 // not supported on windows CE
> 	#else
> 	NULL,
> 	#endif
> 	&procInfo)) {
> 	
> 	WaitForSingleObject(procInfo.hProcess,INFINITE);
> 
> 	CloseHandle(procInfo.hThread);
> 	CloseHandle(procInfo.hProcess);
> }
> 

I applied this to osce.py.
os.system will wait until command returns.
http://www.murkworks.com/Research/Python/PythonCE/PythonCEWiki/uploads/osce.py

Thank you Carl!
Now, PythonCE acts a little closer to standard Python.

PS.

I added GetExitCodeProcess to see if I can get exit status.
But so far I'm getting always 0 ...



=====
Telion
- telionce@yahoo.com -
http://pages.ccapcable.com/lac/PythonCE.html

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com