sharing time between embedded python and c code

Ignacio Vazquez-Abrams ignacio at
Sat Oct 13 06:15:04 CEST 2001

On Sat, 13 Oct 2001 howard at wrote:

> I would like to embed python into a (windows) c-program and spend some
> time in the python interpreter (processing some simple gui updates)
> and some time in my c program (handling some DirectX calls and such).
> I seem to be stuck on how to do this.  I have embedded the Python
> interpreter, can import and run a program, and return (having a
> .mainloop in the python code to pump things).
> However, what I would LIKE to do is
>    1.  Load the python code at initialization time.
>    Loop (at really long time)
>    	a. Periodically call something in the Python code to
> 		perform ".updates" .
> 	b. Periodically call the verklempt Windows/DirectX
> 		routines for the high speed part of things.
> I expect to run several threads:
>      One for my dedicated DirectX updates
>      One for the Python calls.
> I must be missing something since I can't figure out how to call a
> specific function in the interpreter environment without receiving an
> error.
> Any ideas?

It would be helpful to see what you have so far and what errors you're
getting. We're not quite _that_ psychic ;)

Ignacio Vazquez-Abrams  <ignacio at>

   "As far as I can tell / It doesn't matter who you are /
    If you can believe there's something worth fighting for."
       - "Parade", Garbage

More information about the Python-list mailing list