import telnetlib
tn = telnetlib.Telnet(IP)
tn.read_until("abcd login: ") --> This is only to match a particular pattern
Can a generic pattern be included in tn.read_until()
?
Ex: prompt can be "xyz login: " , "abcd login: "
etc
In regular expression, we use re.match('(.*)login: ',prompt)
. But i don't think so, this works in tn.read_until()
because the parameter it expects itself is a pattern. Is there any way to handle it ?