exposing tkconsole with shell in IDLE/IDLEfork
jtauber at jtauber.com
Wed Jun 25 17:25:43 CEST 2003
As a way of achieving my previously mentioned goal of an interactive
Python prompt that can embed non-text in the output window, I made the
following modification in PyShell.ModifiedInterpreter.__init__ in IDLE
(that shipped with 2.2.3)
def __init__(self, tkconsole):
self.tkconsole = tkconsole
locals = sys.modules['__main__'].__dict__
# ADDED THIS LINE
locals["tkconsole"] = tkconsole
self.save_warnings_filters = None
This works great! But trying the same thing in IDLEfork 0.9b1 doesn't
work. "tkconsole" is nowhere to be seen in the shell's locals.
So I have two questions:
- is this the best way to expose tkconsole to the interactive prompt?
(to enable python functions to output graphics, etc embedded in the
- what would I need to do to get this to work with IDLEfork?
More information about the Python-list