using cmd.exe as a telnet client

Josiah Carlson jcarlson at uci.edu
Fri Dec 3 19:28:30 EST 2004


Donnal Walter <donnal at donnal.net> wrote:
> 
> Several months ago I tried using the telnet module (on Windows XP) to 
> communicate with a proprietary host on our network. This was 
> unsuccessful due to problems with "option negotiation", and I gave up on 
> the project for a while. I still have need for this, however, so I 
> recently started thinking about alternatives. I suppose I could dig deep 
> enough into option negotiation to use the socket module (with telnet as 
> a guide), but I am hoping to find a way to use fewer synapses.
> 
> Using the Windows C:> prompt (cmd.exe) I can telnet into this host with 
> no problems (the Windows telnet client performs option negotiation just 
> fine). Is there a straightforward way of using os.popen() (or os.fork() 
> or os.exec*() or os.wait*()) to connect to the host from Python via the 
> Windows telnet client?

I am sure it is possible with a little bit of pywin32 business.  You may
have better luck with the new subprocess module in Python 2.4, as it is
written with communication to/from console applications in mind.

 - Josiah




More information about the Python-list mailing list