I am using Python and pycups.
I would like to know if there is a way to get the state of my printer using pycups.
I tried this :
conn = cups.Connection()
printers = conn.getPrinters()
The problem is that even when the printer is off, I get the printer's name in my variable printers. I would like it to be empty when the printer is off.
Does anyone know which fonction I should use to get the state of my printer ?
The answer was right in front of my eyes... if I print my printer variable, I get a dictionnary which contains the printer's state. However the value of the state is not always correct. For example, I get the state 3, which is supposed to indicate that the printer is availabl,e when it is actually turned off and unplugged... I still need to figure that out.