Python Telnet formatting?

mentaltruckdriver at gmail.com mentaltruckdriver at gmail.com
Sun Mar 2 01:51:08 CET 2008


Hi everyone:

I posted here a couple days ago looking for some help creating a
Telnet-based chat server. You guys pointed me to Twisted, which has
solved most of my issues.

However, what I want to do is analyze strings received for keywords
such as 'listcmds' and have the server return something to the client.
I know how to do that part, at least.

The issue is, when I use clients like PuTTY, it returns a lot of what
appears to be formatting (e.g. if I typed Hello, it would return "\xff
\xfb\x1f\xff\
xfb \xff\xfb\x18\xff\xfb'\xff\xfd\x01\xff\xfb\x03\xff\xfd\x03Hello".)

How would I go about filtering this stuff out of the strings? The
thing is too, if I use other Telnet programs like Microsoft Telnet,
they don't have this formatting, so I want to be able to recognize if
it does have this formatting and act based on if it does or if it
doesn't.

Any help is appreciated, I know I'm probably asking too many questions
already :)

Thanks everyone.



More information about the Python-list mailing list