[python-win32] kernal32.DeviceIoControl Operation Aborted

Tim Roberts timr at probo.com
Fri Dec 19 23:12:39 CET 2008


Red Rackham wrote:
> Mystery solved.  The value on the port had changed from 0x09 to 0x76
> from the time I used the c-based program to the time I came along and
> red it in Python.  Went back and used the c-based program and found
> the port was indeed 0x76.
>  
> I used your "array" example:
>     x = array.array('B')
>     x.fromstring( buffer )
>     t = x.tolist()
>     print [hex(i) for i in t]
>  
> and got back "['0x8b', '0x7c', '0x0', '0x0', '0xff', '0x0', '0xfe',
> '0xb1', '0xff', '0x0', '0x0', '0x0',".
>  
> Woo hoo!!!!  I didn't know that the "array" class was capable of this,
> which is why I was considering the "re" module.
>

Python is an excellent language for dealing with hardware, but if you do
very much of it, you'll find that the "array" and "struct" modules
become indispensable parts of your daily toolkit.

I write drivers for a living, both Windows and Linux.  My debug and
diagnostic tools are almost always written in Python, because it's so
easy to experiment.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list