[Tutor] How to reinvent telnet for serial port?

Siegfried Heintze siegfried at heintze.com
Sun Oct 3 05:28:28 CEST 2004


I need to write a program similar to a telnet server. A telnet server

asynchronously reads data from a socket and writes it to a

sub-process, and asynchronously reads data from the subprocess and

writes to a socket. My program needs to replace the subprocess with a

serial port.

 

The telnet server cannot anticipate when data will arrive from the

socket. Neither can it anticipate when data will arrive from the

subprocess. 

 

How can I write a similar OS vendor neutral program using Python,

except, instead reading and writing to a process, I read and write to

serial port? Can I do this with a single thread? How do I read and

write to a serial port? Can anyone point me to some sample code for

serial port I/O? 

 

  Thanks,

     Siegfried

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20041002/5cfd44af/attachment.html


More information about the Tutor mailing list