python telnet连接
发送{msg}
接收消息日志
1 : ^[]0;ABCD - ABCD - file=/tmp/1234^GConnected to 123.123.123.123 (test=test_ROOT_MO,Context=ABCD,ManagedElement=ABCD)^M
2 : ^M
3 : Last MO: 11668. Loaded 11668 . Total: 11669 MOs.^M
4 : ^M
5 : ^[[1;32mABCD^[[0m>
此消息(^[[1;32mABCD^[[0m>;)日志 ,但telnet conn和send msg
ABCD> msg
ABCD - ABCD - file=/tmp/1234^GConnected to 123.123.123.123 (test=test_ROOT_MO,Context=ABCD,ManagedElement=ABCD)
Last MO: 11668. Loaded 11668 . Total: 11669 MOs.
*ABCD>*
上一个>;颜色饱满(绿色)
问)。我要找到“^[[1;32mABCD^[[0m>;”(ABCD总是变化的)
我在代码下尝试,但失败了
--->;self.teln.read\u直到('\^[.\^[>;*',300个)
对于Tcl expect,我建议:
对于python的telnetlib,似乎
read_until
不能与正则表达式一起工作。我想知道这是否足够:也许你想要
read_eager()
或者read_very_eager()
相关问题 更多 >
编程相关推荐