Windows, RS232, and Python

David Bolen db3l at fitlinxx.com
Fri Feb 1 19:24:37 EST 2002


Spencer Ernest Doidge <spencer at efn.org> writes:

> I want to have control of every aspect of RS232 transmitting and
> receiving in Win9x/NT with Python commands.

Well, the latest win32all packages pretty much wraps all the Win32 API
functions provided for managing the serial port, so you should be able
to do it the same way you would with Win32 API calls, just using that
wrapper.  Documentation for win32all contains any Python-specifics in
the wrappers, but you would use the standard Win32 API documentation
for the calls themselves.

> A. Extend Python as needed, then embed this extended Python into my GUI
> app. This would necessitate maintaining two applications: the extended
> command-line Python for the behind-the-scenes users, and the GUI app for
> the customers.

I'm not quite sure what you mean by "this extended Python".
Typically, when one talks about "extending" Python they are referring
to writing an extension module.  Such a module acts just like a
standard Python module and can be imported into standard production
interpreters and code.

So you could just write an extension module that covers any APIs that
aren't already wrapped.  Then just import that module into your
overall script and you're set.  This is the approach we took before
the serial API calls were fully wrapped in win32all, and is similar to
some of the other serial access packages mentioned here at times.

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list