PySerial for Python 2 vs. Python 3

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Jan 1 01:57:39 EST 2014


Travis McGee wrote:

> I've been working with a simple serial device that attaches to a USB
> port. It takes as commands short strings.
> 
> I wanted to use PySerial under Python 3, and, of course had the Devil's
> own time getting it installed and working since everything is geared
> towards Python 2.
> 
> Anyway, I finally got it installed, but when I try to use a statement of
> the sort ser.write("string") I get an exception which seems to imply
> that the argument needs to be an integer, rather than a string.

"Seems to imply"?


> With some minor adjustments it works just fine under Python 2, so, in a
> sense, this is a non-issue. However, I'd be interested to hear from
> anyone who can comment on what the problem is.

While I'd love to tell you exactly what the problem is, my crystal ball is
out of action. If you'd be so kind as to copy and paste the actual
exception, assuming it isn't a secret, perhaps we'll be able to tell you
what it actually says.


-- 
Steven




More information about the Python-list mailing list