I have this sample code here that is supposed to choose one particular printer when trying to print or scan something. But to do so with my code below, I need the name of the device and I couldn't figure out a way to get the right name, so the script recognizes the right device:
devs = pyinsane2.get_devices()
devices = None
for dev in devs:
if dev.name == "hplip://32.13241":
devices = dev
break
if devices is None:
print("Not found")
else:
print("Will use {} {}".format(devices.vendor, devices.model)
hplip://xxx is obviously the printer, but this one is the printer of the sample. I need to insert my own printer ID in there. Anybody knows how I get this ?
In my current code, where it just chooses the Printer on its own, it tells me it found the printer
'Brother MFC-J6710DW LAN' (Brother, Brother MFC-J6710DW LAN, scanner,streaming_video)
.
is it the device ID? Can anyone tell me what the number in the smaple code stands for?
What I have tried:
Insterting the found printer name as name doesn't work. So it looks like this:
for dev in devs:
if dev.name == "'Brother MFC-J6710DW LAN' (Brother, Brother MFC-J6710DW LAN, scanner,streaming_video)":
devices = dev
break
This doen't work and it chooses
None