Mark Hammond wrote:
> I'm not sure what could cause this - accidently assigning to
> AttributeError
>
>could possibly cause it, but I can't see any such thing in the code snippet.
>Is that code snippet your *entire* test program?
>
>
>
Yes, the snippet of code was the complete code listing... however I
made a few changes to it since my last mail and found that when running
it (as you suggested) with the command line (and NOT within the IDE that
I am using - WingIDE) it ran with no errors printed. After some
adjustments to the IDE - it now runs and ignores that error inside the IDE.
Still no data from the swipes though. That is the #2 thing on my
original list. I am going to get a full working example in vbscript to
respond with - but in the mean time, here is my current code - see
anything wrong in it? ..or that might prevent it from spewing forth
some data ...assuming that the swiper is getting data and that my event
convention is correct (which I believe it is now - thank you)
############# current code - complete [start]
# Necessary modules
from win32com.client import DispatchWithEvents
# Event class for the USB HID Swiper instance below
class SwiperEvents:
def OnCardDataChanged(self):
print "CardData: %s" % self.CardData
# create a USB HID Swiper instance with event capabilities
swiper = DispatchWithEvents('ctlUSBHID.USBHID', SwiperEvents)
# Set and test the port to the device
print swiper.PortOpen
swiper.PortOpen = True
print swiper.PortOpen
swiper.ClearBuffer()
# Wait for data or user intervention
while 1:
pass
print "Done."
############# current code - complete [end]
_______________________________________________
Python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32