On Sunday 06 April 2003 12:42, Fred Trotter wrote:
> modem control is
> really not the problem. 
Apropos that, I had been thinking that surely the modem is under 
control of the network layer, and one writes code that expects 
the network to take care of connection and disconnection - but 
now I see this is working to legacy systems.  The modem might 
still vanish in favour of ssh/Telnet at any time, might it not.

> The problem is handling the menu
> system after login. Doing this is pretty difficult because one
> has to program in stages of operating a text based menu. This
> requires basically emulating a user at a terminal
> pragmatically, which can only be handled by expect.

OK, you are interfacing to an existing system elsewhere that 
expects to have someone typing directly to it.
This is a pragmatic approach, even if ideally one would be going 
a layer below that.

Python has stuff in it that handles that problem, including 
something one can do with popen - open a pipe from STDIN which 
one controls and passes input to the terminal emulator, and a 
pipe from that to STDOUT which again one controls.  

You then have total control of it, and expect is not necessary.
On Windows that seems to be one of the standard techniques 
available to bring a DOS application (eg terminal emulator) into 
integration with a multi-tasking application, and similar 
effects are offered under Linux.
-- 
From one of the Linux desktops of Dr Adrian Midgley 
http://www.defoam.net/             

Reply via email to