Expect Telnet

Vinay Sagar Prakash vinya.jag at gmail.com
Thu Aug 9 08:57:34 CEST 2007


Hi all,

I am not sure how this works, but am composing my query here.

I am trying to expect the below snippet using telnetlib.

#################
bash# install
blah blah blah
do you want to continue [y/n]? y
blah blah blah
 blah blah blah
blah blah blah
blah blah blah
Installation complete
bash#
##################

For the above, i am doing
t.read_until("bash#")
t.write("install\n")
t.read_until("n]? ")
t.write("y\n")
t.read_until("bash#")
t.write('exit\n")

However, from the time i key 'y/n' till the install script exits, there is a
lot of data that is to be logged. I takes around 1 hour for the whole script
to exit.
Is there some way i can read whats happening behind the scenes until it hits
the read_until?

Thanks for the help
-- 
Vinay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070809/614d49a6/attachment.html>


More information about the Python-list mailing list