Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #28088
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Subject | Re: Sending USB commands with Python |
| Date | 2012-08-30 00:55 -0400 |
| Organization | > Bestiaria Support Staff < |
| References | (1 earlier) <20120829222932.GA18700@cskk.homeip.net> <mailman.3947.1346280975.4697.python-list@python.org> <ad907349-042b-4ddf-aef7-043d7dfb1f9a@googlegroups.com> <mailman.3952.1346292474.4697.python-list@python.org> <5d063028-3d3f-42f2-8787-b33d58460c35@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3957.1346302513.4697.python-list@python.org> (permalink) |
On Wed, 29 Aug 2012 20:53:48 -0700 (PDT), "Adam W."
<AWasilenko@gmail.com> declaimed the following in
gmane.comp.python.general:
> Your notation does work, and I was just coming around to reevaluating the use of the encode because I am getting really odd results when trying to print lines.
>
> For example I set the byte length to 10 and sent this 500 times or so expecting to get a solid black bar:
> ep.write('\x16FFFFFFFFFF'.encode('utf-8'))
How many bytes did it claim to send?
>
> But what I got was a weird stripped pattern... I feel like a lot of my commands are working by chance, I can't explain to myself why the A in \x1bA isn't being treated as part of the hex. This stuff always confuses me.
>
That's the easy one -- \x in a string introduces an 8-bit byte value
-- so only two hex digits well be read. The "A" is interpreted as
regular text.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Sending USB commands with Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-08-29 18:56 -0400
Re: Sending USB commands with Python "Adam W." <AWasilenko@gmail.com> - 2012-08-29 16:45 -0700
Re: Sending USB commands with Python MRAB <python@mrabarnett.plus.com> - 2012-08-30 01:53 +0100
Re: Sending USB commands with Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-08-29 22:07 -0400
Re: Sending USB commands with Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-08-30 00:55 -0400
Re: Sending USB commands with Python "Adam W." <AWasilenko@gmail.com> - 2012-08-30 05:51 -0700
Re: Sending USB commands with Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-08-30 14:24 -0400
Re: Sending USB commands with Python Cameron Simpson <cs@zip.com.au> - 2012-08-31 08:47 +1000
csiph-web