Python commands

Chris Liechti cliechti at gmx.net
Sun Apr 6 14:15:57 EDT 2003


"Paul Dexter" <dextech at terrigal.net.au> wrote in
news:3e8e5d85$1_1 at news.iprimus.com.au: 

>     Hi all,
>                 Thanks for all the advice and links to the libraries.
>     I sometimes build hardware to connect to the computer via the
>     serial or 
> parrallel ports, so a peripheral driver is not usually available.
>     I now have a lot of reading to do, to get Python to transfer data
>     thro'  the port to my device.

>     Things aren't as straight forward as the DOS days with all the
> multitasking multithreading features we seem to demand.         LOL

1. do you realy need threads for your app?
1a. if so consider using a Queue and exactly one thread for reading and 
writing (or if your protocol allows this, one thread for reading and an 
other for writing)

2. learn asynchronous programming. Twisted provides a good framework to do 
so. it already has serial port support (for win32 too, in the CVS version)
it does not yet have parallel port support, but depending on your 
application, it may be easy to add.

both, the queue or async programming, can make your life a lot easier.

chris
-- 
Chris <cliechti at gmx.net>





More information about the Python-list mailing list