code.InteractiveConsole in a newly created xterm

Simon Budig Simon.Budig at unix-ag.org
Tue Jan 29 22:37:18 EST 2002


Hi all.

The following works great:

import code
def python_inter():
        ip = code.InteractiveConsole ()
        ip.interact ("Python interactive Console")

However, I want to have this in a freshly created xterm window and I have
not been able to figure this out. I guess I somehow have to use
pseudo terminals and the xterm "-S" option. Something like (pseudocode):

import code,spam
def python_inter():
        xterm = spam.create_xterm_instance ()
        ic = code.InteractiveConsole ()
        ic.connect_to_xterm (xterm)
        ic.interact ("Python interactive Console")
        xterm.close ()

Is this possible? For as much Unix-like platforms as possible?

Thanks!
        Simon


-- 
      Simon.Budig at unix-ag.org       http://www.home.unix-ag.org/simon/



More information about the Python-list mailing list