Python + WinMFC message loop

Fredrik Lundh effbot at telia.com
Mon Mar 13 12:42:23 EST 2000


Robert Kiendl <rkiendl at gmx.net> 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.

usage:

1. create a InteractiveInterpreter instance

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

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 code.py

</F>





More information about the Python-list mailing list