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

Peter Hansen peter at engcorp.com
Sun Dec 30 00:39:41 CET 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 engcorp.com

========= WAS CANCELLED BY =======:
Path: news.sol.net!spool1-milwwi.newsops.execpc.com!newsfeeds.sol.net!newspump.sol.net!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!enews.sgi.com!news-xfer.nuri.net!feeder.kornet.net!news1.kornet.net!ua4canc3ll3r
From: Peter Hansen <peter at engcorp.com>
Newsgroups: comp.lang.python
Subject: cmsg cancel <3C2E543D.4BFB07D at engcorp.com>
Control: cancel <3C2E543D.4BFB07D at engcorp.com>
Date: Mon, 31 Dec 2001 03:22:28 GMT
Organization: A poorly-installed InterNetNews site
Lines: 2
Message-ID: <cancel.3C2E543D.4BFB07D at engcorp.com>
NNTP-Posting-Host: 211.57.49.2
X-Trace: news2.kornet.net 1009774486 27193 211.57.49.2 (31 Dec 2001 04:54:46 GMT)
X-Complaints-To: usenet at news2.kornet.net
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