SyntaxError: invalid syntax (windows)
MRAB
google at mrabarnett.plus.com
Wed Mar 25 13:19:29 EDT 2009
Python Newsgroup wrote:
> Gotcha, I got started from the telnet example listed in the docs. The
> linux install was via yum and installed 2.x instead. That explains it.
> Althought print (tn.read_all () ) runs in 2.x on linux.
>
> I have another problem maybe you cna help me with. My telnet output
> jibberish in windows: I cna parse some of the output for results but is
> there anyway to get rid of the jibberish. (looks like hex but I'm not sure)
>
> I can only use this tn.read_until(b'whatever string') Is this whats
> causing the output? the b switch. seems like I don't need it in linux.
> is that binary?
>
> Thanks
>
> C:\Python30>python \Python30\scripts\telnet-tftp1.py
> b'\x1b[24;1H\x1b[24;31H\x1b[24;1H\x1b[?25h\x1b[24;31H\x1b[24;31Hy\x1b[24;31H\x1b
>
> [?25h\x1b[24;32H\x1b[24;0H\x1bE\x1b[24;1H\x1b[24;32H\x1b[24;1H\x1b[2K\x1b[24;1H\
>
> x1b[?25h\x1b[24;1H\x1b[1;24r\x1b[24;1H\x1b[2J\x1b[?7l\x1b[1;24r\x1b[?6l\x1b[24;1
>
> H\x1b[?25h\x1b[24;1H\x1b[?6l\x1b[1;0r\x1b[?7l\x1b[2J\x1b[24;1H\x1b[1;1H\x1b[2K\x
>
> 1b[24;1H\n\r'
>
> C:\Python30>
>
They look like control sequences for a terminal.
More information about the Python-list
mailing list