Newbie: Python & Serial Port question

Peter Hansen peter at engcorp.com
Thu Dec 1 01:03:51 EST 2005


Sanjay Arora wrote:
> Am a python newbie. Does python have a native way to communicate with a
> PC serial port? I found that pyserial needs java.

This is not true unless you are using Jython.  The code in 
serial/__init__.py does this:

if os.name == 'nt': #sys.platform == 'win32':
     from serialwin32 import *
elif os.name == 'posix':
     from serialposix import *
elif os.name == 'java':
     from serialjava import *

so the java stuff will not be used on regular Python under "nt" 
(Windows) or Linux.


-Peter




More information about the Python-list mailing list