Is it possible to pass the result of a python script (a reading from a usb device) directly to where the cursor is active within windows?
Ive been looking for a solution to this problem all weekend and I think I may be phrasing my question wrong or maybe looking in the wrong places. I know that you cannot just pass a result to an active input box in PHP (ive asked this on Friday) and this is a different scenario.
I am very much new to Python and any assistance or direction to a solution would be great. Im not looking for the straight up answer - just the correct direction.
Thanks in advance and happy monday!
EDIT: I found some of this open source and wrote some of it as well... I am getting an EOL while scanning string literal.
I am almost positive it has something to do with the formatting, but I cannot find it. Can someone please take a look at the code and let me know what I might be doing wrong?
import usb.core
import usb.util
VENDOR_ID = 0x0922
PRODUCT_ID = 0x8003
# find the USB device
device = usb.core.find(idVendor=VENDOR_ID,
idProduct=PRODUCT_ID)
# use the first/default configuration
device.set_configuration()
# first endpoint
endpoint = device[0][(0,0)][0]
# read a data packet
attempts = 10
data = None
while data is None and attempts > 0:
try:
data = device.read(endpoint.bEndpointAddress,
endpoint.wMaxPacketSize)
except usb.core.USBError as e:
data = None
if e.args == ('Operation timed out',):
attempts -= 1
continue
SendKeysCtypes.SendKeys(data+'{ENTER}’, 0)