REPOST: Re: values of sys.platform? for a serial port lib

Chris Liechti cliechti at
Sun Dec 30 13:33:22 CET 2001

Peter Hansen <peter at> wrote in
news:3C2E82A5.D4E1EEB3 at 
> Chris Liechti wrote:
>> i also have an optional argument to specify the port string, but when
>> this is used it isn't portable anymore. 
> Just a thought, but could you make this the same argument as 
> the port number, allowing either an integer or a string?  
> I could also see a benefit, in a cross-platform serial-port app, 
> in having a method to return the actual device name in use, for 
> display/troubleshooting purposes, even if specified as a number.

minutes after i wrote the that message, i changed the code so that it is 
the same argument that takes a number or a string.

i'll add a method to return the device name.

> You may know this already, but in Windows you need to use 
> "overlapped" I/O operations if you want to be able to have
> a read thread and a write thread waiting independently on 
> operations on the same serial port.  Without this, any time 
> one thread is blocked waiting for results for its operation, 
> the other thread will also block when it tries to access the 
> device even if its operation would not otherwise block.  
> (Or something like that... I don't know the full details 
> behind it, only what I learned trying to implement a win32file-
> based serial port class which didn't have this limitation.)
it uses overlapped io. it's roughly based on the serial example that comes 
with the win32all package.


Chris <cliechti at>

========= WAS CANCELLED BY =======:
From: Chris Liechti <cliechti at>
Newsgroups: comp.lang.python
Subject: cmsg cancel <Xns91878A529880Fcliechtigmxnet at>
Control: cancel <Xns91878A529880Fcliechtigmxnet at>
Date: Mon, 31 Dec 2001 04:08:23 GMT
Organization: A poorly-installed InterNetNews site
Lines: 2
Message-ID: <cancel.Xns91878A529880Fcliechtigmxnet at>
X-Trace: 1009774258 27193 (31 Dec 2001 04:50:58 GMT)
X-Complaints-To: usenet at
NNTP-Posting-Date: Mon, 31 Dec 2001 04:50:58 +0000 (UTC)
X-No-Archive: yes
X-Unac4ncel: yes
X-Commentary: I love NewsAgent 1.10 and the Sandblaster Cancel Engine Build 74 (19 March 1999)

This message was cancelled from within Mozilla.

More information about the Python-list mailing list