1

I'm trying to do a putty-like in python for personnal solution but i can't read the resultat properly. I receive all ansi code from the switch

b'HEWLETT-PACKARD COMPANY, 3000 Hanover St., Palo Alto, CA 94303\r\r\x1b[1;24r\x1b'
b'[20;1H\x1b[20;1HPassword: \x1b[?25h\x1b[20;1H\x1b[?25h\x1b[20;11H'

I tried a regex but in fact is not very easy because strings can be [20;1 or [25;HH so when it stucks to a real string like Password ([25;HPassword) it can't be escape with regex (or i don't know how to do).

I tried to modifie my terminal configuration from windows, changing the TERM by (https://technet.microsoft.com/en-us/library/95e1a3ae-f639-44f1-ba4a-81fd11c95dfe#bkmk_1):

TERM=vt100, TERM=vt52, TERM=ansi, TERM=vtnt 

but nothing works. I work with python 3.4, telnetlib for python, windows 7 (and pycharm)

I'm thinking about a biggest regex but maybe there is a simple way to configure it from windows ?

Pierro
  • 11
  • 3

0 Answers0