serial, parallel and USB port

  • Thread starter =?ISO-8859-1?Q?St=E9phane?= Nufer
  • Start date
?

=?ISO-8859-1?Q?St=E9phane?= Nufer

Hello,

Why are there no module to access serial, parallel or USB port in python.
This could be great to build front end software to control electronic
device or even automaton in industrial process ( or maybe I should ask why
the existing third party modules such as pyserial have not been integrated
in the official release)

Regards,
 
J

Josef Dalcolmo

And if you want USB access, I have done a Python wrapper around libusb
that works on Windows, Linux and Mac:

http://cvs.sourceforge.net/viewcvs.py/bitpim/bitpim/native/usb/

Interesting. From a first glance at it I think one has to compile the extension oneself. Now, I for example do not have MS-C installed - Cygwin is still a World apart and MinGW doesn't compile Python out of the box either.

So the original posting may also read as:
why aren't these interface in the standard distribution?

The answer is probably, "because nobody volunteered to stuff them in there" - but I admit I wish too, these I/O routines were in the standard distribution, especially for the USB stuff, since USB interfaces are ubiquitous nowadays.
 
R

Roger Binns

Josef said:
Interesting. From a first glance at it I think one has to compile the extension oneself.

That is correct for all platforms.
Now, I for example do not have MS-C installed

Neither do I.
Cygwin is still a World apart

I don't have Cygwin installed either.
and MinGW doesn't compile Python out of the box either.

That doesn't matter. Why do you need to compile the whole of Python?

MinGW compiles extensions perfectly including the USB which I have
been shipping for almost a year (using the standard Python distribution).
Just use MinGW and you will have happy USB access on Windows. The other
platforms work fine with the standard system compiler (gcc).

You can also compile any distustils based extension as well using mingw:

python setup.py build --compiler=mingw32 bdist_wininst
So the original posting may also read as:
why aren't these interface in the standard distribution?

A different answer is because it ties their release schedule to that of Python
rather than their underlying libraries. The Windows version of pyserial uses
win32all which isn't a standard part of Python on that platform. My USB stuff
depends on libusb which has a seperate release schedule to Python.

In reality they are not very popular. pyserial manages just over 1,000 downloads
a month and I have no idea how much the USB stuff is, but suspect it is closer
to 5 a month.

Python defines an extension mechanism that is fairly easy to use to distribute
extensions. I don't see what the difficulty in using them is. And if you
need a C compiler on Windows, MinGW does the job fine.

Roger
 
J

Josef Dalcolmo

MinGW compiles extensions perfectly including the USB which I have
been shipping for almost a year (using the standard Python distribution).

Oh, many thanks, for this hint. That simplifies things tremendously. I suppose I could even try PyRex with MinGW on Windows!

Do you need to run MinGW from MSYS or does it any old command prompt box?

- Josef
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top