Getting the list of available printers/classes - from Pure Python?
Romain Jacquet
romain.jacquet at clarisys.fr
Fri Feb 17 07:27:23 PST 2006
Erik Forsberg a écrit :
> Hi!
>
> I'd like to get hold of the list of available printers from a python
> program, without using a C extension (that is, I don't want to link to
> the standard cups C libraries). The reason for not linking to the C
> libraries is that it's much harder to distribute the software when it
> needs C extensions (which are python-version-specific, IIRC).
>
> Any ideas on this? Is there a binary always present on a host with
> CUPS installed I can run and parse output from?
Try to parse lpstat -a.
> Should I talk directly
> to CUPS on 127.0.0.1:631 and issue a IPP request?
It is another solution. See the post :
"IPP + Python : comments and contributors welcome" on
cups.developpement. It could help.
More information about the cups
mailing list