Python + WinMFC message loop

Fredrik Lundh effbot at
Mon Mar 13 18:42:23 CET 2000

Robert Kiendl <rkiendl at> wrote:
> the problem is, that there is no non-blocking function for interactive
> input in the python api. PyRun_InteractiveOne would block my message
> pump until the end of a complete statement (def , class , ...)

but there is one in the standard library; see the
InteractiveInterpreter class in the code module.


1. create a InteractiveInterpreter instance

2. redirect sys.stdout and sys.stderr to your output

3. when the user enters a line in the input widget,
   use "push" to pass it on to the interpreter.

for more info, see the docstrings in


More information about the Python-list mailing list