"send" delete key - python & telnetlib

Associate
Joined
10 May 2007
Posts
716
1st Python experience- knocked a script up to reboot a network device using the telnetlib to connect & send/recieve the commands. This works fine, however the problem im having is that upon connecting the command line displays the previous command issued so my script just writes over the top; E.g.

Code:
> exitreboot

like that.. Also to make things worse the backspace key wont clear the 'exit', only the DEL key will remove the text. So, what I need to do is "send" the delete key several times before issuing the command. Its messy but I cant think of any other way. Any ideas on how I can do this?
 
Well, i've been reading some more and apparently its not possible this way. However you can send the raw data with the socket library. Im not sure if it's possible to inject this data into an existant telnet connection rather than opening a new socket connection? Any ideas?
 
Back
Top Bottom