Sending USB commands with Python

Cameron Simpson cs at zip.com.au
Wed Aug 29 18:29:32 EDT 2012


On 29Aug2012 17:57, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
| On Wed, 29 Aug 2012 14:21:30 -0700 (PDT), "Adam W."
| <AWasilenko at gmail.com> declaimed the following in
| gmane.comp.python.general:
| > You are correct about the 2 being the number of bytes written.  However when I issue a read command I get:
| > 
| > >>> ep.write('\x1BA')
| > 4
| 
| 	That's interesting -- as if each byte you send is expanding into a
| pair of bytes.

UTF-16? ISTR that Windows often uses big endian UTF-16 for filenames and
text data; could there be some default encoding in ep.write getting in
your way?

Disclaimer: I'm really not a Windows guy.
-- 
Cameron Simpson <cs at zip.com.au>

There are too many people now for everyone to be entitled to his own opinion.
- Dr. Handelman



More information about the Python-list mailing list