Currently I am doing some tests with printers in Python, what I am trying to do is to list all the printers available.
Right now I am using PyCups library which exposes several useful APIs in the Connection
class. Among these there's also getPrinters()
:
Here's a snippet that I use and works:
>>> import cups
>>> conn = cups.Connection ()
>>> printers = conn.getPrinters ()
>>> for printer in printers:
... print printer, printers[printer]["device-uri"]
Brother_MFC_1910W_series
Photosmart_6520_series
I was wondering if there's any method to write the above code without using any external library. I am quite sure this can't be done without using C.
Any suggestion or reference to docs would be very appreciated. Thanks
I am using Python 3