[Pythonmac-SIG] (no subject)

Bill Bedford billb@mousa.demon.co.uk
Wed, 6 Dec 2000 10:49:05 +0000


At 1:17 pm -0800 05/12/00, Christian Reyes wrote:

>Ok, real quick one.
>How do I get python to yield to other processes on the mac?
>

If you need a sledgehammer approach you can bring the other process 
to the front.

_InterfaceLib = calldll.getlibrary('InterfaceLib')

_GetCurrentProcess = calldll.newcall(_InterfaceLib.GetCurrentProcess,
			'None', 'InLong')

_SetFrontProcess = calldll.newcall(_InterfaceLib.SetFrontProcess,
			'OSErr', 'InLong')

def exportart():
	buffer = array.array('c', '\0\0\0\0\0\0\0\0')
	ptr = buffer.buffer_info()[0]
	_GetCurrentProcess(ptr)

	Do some apple event stuff

	_SetFrontProcess(ptr)

-- 
Bill Bedford

There has been an alarming increase in the number of things you know
nothing about.