Re: [Tutor] Print list vs telnetlib.telnet.write differences

2006-03-06 Thread Python
hon > Sent: Tuesday, 7 March 2006 12:52 PM > To: Tutor Python > Subject: Re: [Tutor] Print list vs telnetlib.telnet.write differences > > On Tue, 2006-03-07 at 11:31 +1000, STREET Gideon (SPARQ) wrote: > > Enter configuration comman

Re: [Tutor] Print list vs telnetlib.telnet.write differences

2006-03-06 Thread Python
On Tue, 2006-03-07 at 11:31 +1000, STREET Gideon (SPARQ) wrote: > Enter configuration commands, one per line. End with CNTL/Z. > switch01(config)#banner exec ^ > > ## > > switch01 > > Level XX, XX Some Street, Somewhe

Re: [Tutor] Print list vs telnetlib.telnet.write differences

2006-03-06 Thread STREET Gideon (SPARQ)
he sent commands? It looks like the script is looping on the print blob, but I can't see why it should do that? Thanks Gideon (I can send through the entire script but it's a 170+ lines and didn't want to send an epic email to the list) -Original Message----- From: Pyth

Re: [Tutor] Print list vs telnetlib.telnet.write differences

2006-03-03 Thread Python
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 b

Re: [Tutor] Print list vs telnetlib.telnet.write differences

2006-03-02 Thread David Heiser
I believe you can submit the new config content as a blob where blob = string.join(lines). It looks like your "switch" uses IOS, not CatOS, so make sure you send "config t" first. And I would strip out the \r's. Then maybe: tn.write("\03") # Assures the device