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

Peter Hansen peter at
Sat Dec 29 18:39:41 EST 2001

Chris Liechti wrote:
> i've written a portable serial port library. it runs now on linux and win32
> (using marks win32all) but i would like to make it compatible with more
> unix like platforms. basicaly it should run on any POSIX compilant system.
> i'm interested in values for "sys.platform" and, if possible, the name of
> the serial port (an how the ports are numbered ttyS0, ttyS1 etc.)
> e.g "linux2" and "/dev/ttyS%d" % port, numbering starting at zero.

Between links on Unix, third-party serial port devices under
Windows which might not use the COMx convention, and other such
variations, I'd strongly recommend you *not* try to use an
index origin of 0 but instead pass the open() routine (or
whatever you have) a *string* naming the serial port.

By the way, does your win32 implementation work well with
threads, if one thread is trying to read from the port while
the other is trying to write to it?

Peter Hansen, P.Eng.
peter at

========= WAS CANCELLED BY =======:
From: Peter Hansen <peter at>
Newsgroups: comp.lang.python
Subject: cmsg cancel <3C2E543D.4BFB07D at>
Control: cancel <3C2E543D.4BFB07D at>
Date: Mon, 31 Dec 2001 03:22:28 GMT
Organization: A poorly-installed InterNetNews site
Lines: 2
Message-ID: <cancel.3C2E543D.4BFB07D at>
X-Trace: 1009774486 27193 (31 Dec 2001 04:54:46 GMT)
X-Complaints-To: usenet at
NNTP-Posting-Date: Mon, 31 Dec 2001 04:54:46 +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