Get list of printers with Python

Python is a high-level, general-purpose programming language. It constructs the object orient approach aim to help programmers to enable logical code for small and large-scale applications.
In Python win32print API, give the list of printers available in the operating system. Here I have mentioned the sample code which is capable of retrieving the printers name of the operating system.

import win32print

printers = win32print.EnumPrinters(win32print.PRINTER_ENUM_LOCAL, None, 1)
print (printers)

After executing the above-mentioned script it will return the printers.

Output will be,

((8388608, 'Send To OneNote 2013,Send to Microsoft OneNote 15 Driver,', 'Send To OneNote 2013', ''), (8388608, 'Send To OneNote 16,Send to Microsoft OneNote 16 Driver,', 'Send To OneNote 16', ''), (8388608, 'Microsoft XPS Document Writer,Microsoft XPS Document Writer v4,', 'Microsoft XPS Document Writer', ''), (8388608, 'Microsoft Print to PDF,Microsoft Print To PDF,', 'Microsoft Print to PDF', ''), (8388608, 'HP LaserJet Pro MFP M126nw,HP LaserJet Pro MFP M125-M126 PCLmS,http://[fe80::de4a:3eff:feb1:27f0%24]:3911/b71a04d3-29ba-343d-fa3c-80bf5e6784c6', 'HP LaserJet Pro MFP M126nw', ''), (8388608, 'Fax,Microsoft Shared Fax Driver,', 'Fax', ''), (8388608, 'Adobe PDF,Adobe PDF Converter,', 'Adobe PDF', ''))

Comments