views:

23

answers:

0

Hi,

I have following python code:

import telnetlib
ts = telnetlib.Telnet('192.168.0.2')
ts.set_debuglevel(10)
ts.read_until("assword:", 5)
ts.write("xxxxx\n")
ts.write("enable\n")
ts.read_until("assword:", 5)
ts.write("xxxxx\n")
ts.write("term len 0\n")
ts.write("show start\n")

But how can i read the buffer only from "show start" command? If i try to read_(very)eager or read_all() I get all previous output too. Im confused because it looks like i should parse string on my own wrrr :( Maybe im wrong?