Terminal Emulation

Hans-Joachim Widmaier hjwidmaier at web.de
Sun Apr 13 03:40:29 EDT 2003


All of my embedded software offers a means of debugging via a serial
interface. You just hook a terminal onto it and start introspection. These
days, of course, the "terminal" is usually a computer running a terminal
emulator, and the embedded software allows you to do more than just view
memory contents, e. g., download a new software. Of course, I handle this
download with a python program. Now you have 2 programs: the terminal
emulator and the download utility. Not too much hassle under unix, as the
downloader ignores that the serial port is already used by the terminal
emulator, it just does its job and leaves the port in the same state it
had found it, the emulator doesn't even notice.

This doesn't work under Windows, though. So I thought about creating a
terminal emulator with some added functionality. Some thinking revealed
that I didn't know a widget that was handy for the job. Some more
thinking gave me an idea for a unix solution: xterm in slave mode.
Obviously, this only works where I don't really need it. A google search
showed that some others also had a use for such a terminal emulation
widget, but none seems to exist.

Not knowing wxWindows, pyQt and what-have-you, the Tkinter Text widget is
about the only thing left. I'd have to grab all keyboard events away from
it (yuck) and do the escape sequence interpretation by myself (not too
bad, as I only need a subset of the whole vt100/vt320 stuff). The Text
widget just seems way too "heavy" for this.
Handling serial input/output as well as GUI events gives me problems
enough already. ;-)

Has anyone found a nicer solution in the meantime? No problems if it meant
using wxPython or pyGTK. (No pyQt, though, as it's not free under Windows.)

I'd be grateful for any suggestions.

Hans-Joachim




More information about the Python-list mailing list