[Tutor] Python coding

Kent Johnson kent37 at tds.net
Mon Sep 12 23:04:33 CEST 2005


tuvas at email.arizona.edu wrote:
> I am working on a project that we have built a C Text interface previously. We
> want to be able to move this to a graphical interface, and after some studying,
> we decided to use a python-based interface. We want to use as much of the old
> code as possible, so we have decided to try an interface with python that will
> send the old commands directly. EI, the old interface required that to do a
> function called ping, you hit 0, so Python will basically tell the program to
> hit 0. I have been looking up information on how to do this, and am coming up
> short. Can you help me? Thank you!

If you are running on Linux then pexpect may help you. (It requires the pty library module which is not available on Windows.)
http://pexpect.sourceforge.net/

Kent



More information about the Tutor mailing list