On Sun, Oct 21, 2007 at 9:47 PM, Xiaofan Chen wrote: > It is rather strange that I could not find a Python wrapper for the > native HID api (hid.dll) under Win32. Wouter was looking for one > before. > http://mail.python.org/pipermail/python-list/2004-April/258892.html > > If it is not HID but a generic usb device, libusb/pyusb might be > a good combination under Windows/Linux/Mac OS X/FreeBSD. > > libusb (GPL/LGPL): http://libusb.sourceforge.net/ > libusb-win32 (GPL/LGPL): http://libusb-win32.sourceforge.net/ > pyusb (BSD license): http://pyusb.berlios.de/ > > libhid (include python-hid wrapper using SWIG) is supposed to > be a cross platform for HID device. But it is based on libusb > and libusb does not have a cross platform API to detach the > kernel HID driver under Windows/Mac OS X/FreeBSD. In > fact, libhid is not officially ported to Windows yet. > > libhid webpage: http://libhid.alioth.debian.org/ > libhid is under GPL license even though the authors want to > use something like Artistic license. > > The development version of libusb-win32 is supposed to have > a backend based on HID but it is not working yet. > > It seems to me there is an native HID API wrapper for > Mac OS X. > http://www.wooji-juice.com/free/pyhid/readme.html > > It seems to me that this should not be so difficult for > experienced Python developers. After all, VB/VC/C# > wrapper using P/Invoke are quite well documented > in various websites (including lvr.com). > This is a very old post. Today I happen to come across this page. It is not mature, but it seems to be promising. http://pypi.python.org/pypi/pywinusb/0.2.3 C:\pywinusb\pywinusb-0.2.3\pywinusb-0.2.3\examples>python pnp_sample.py saddly my device is not here... yet :-( Hey, a hid device just disconnected! Hey, a hid device just connected! saddly my device is not here... yet :-( (unplug and plug PICKit 2). Of course pyusb-1.0 may get there as well with the new Windows backend for libusb-1.0 (WinUSB, HID, and libusb0.sys backend, the first two backends are working quite well now, 3rd one is in progress). pyusb: http://sourceforge.net/projects/pyusb/ (use the svn development branch, but it is not stable yet) libusb 1.0 Windows backend: http://www.libusb.org/wiki/windows_backend (to me this is quite stable already, but I might be biased as one of the main initial tester). -- Xiaofan http://mcuee.blogspot.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist