[Tutor] Print list vs telnetlib.telnet.write differences
Python
python at venix.com
Fri Mar 3 18:42:24 CET 2006
On Fri, 2006-03-03 at 15:41 +1000, STREET Gideon (SPARQ) wrote:
> The problem I'm stumbling over is that when I print x, the output is
> what I want. If I delete the print x and #, leaving only tn.write(x)
> on
> the last line everything looks good except it writes the 1st item in
> "lines" (the banner exec command) twice, once at the beginning where
> it's supposed to, but then once again at the end. See except below for
> example.
>
> Anyone able to explain why that is happening or is it me just not
> understanding what I'm doing? Hope my explanation is clear I'm still
> unfamiliar with the exact phrasology.
>
Could that be your data being echoed back to you? Is the router
configured correctly after the script runs?
I normally feed commands to Cisco devices using tftp. It is relatively
easy to edit a file to get the commands correct. Then you could limit
your "conversational script" to logging in and running tftp to transfer
the command file.
It looks like you are pretty close to having this working.
--
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358
voice: 603-653-8139
fax: 320-210-3409
--
Lloyd Kvam
Venix Corp
More information about the Tutor
mailing list