467,198 Members | 1,111 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,198 developers. It's quick & easy.

Printer List from CUPS

Hi,

I want to get the printer list from CUPS. I found some ways using

lpstat -p and
http://localhost:631/printers

but, these ways require some parsing and I am not sure, if the parsing
works all the time. A pythonic way would be very helpful.

Thanks,
Mike

Sep 8 '05 #1
  • viewed: 3141
Share:
5 Replies
Mike Tammerman wrote:
Hi,

I want to get the printer list from CUPS. I found some ways using

lpstat -p and
http://localhost:631/printers

but, these ways require some parsing and I am not sure, if the parsing
works all the time. A pythonic way would be very helpful.

Thanks,
Mike


Just for fun I tried this on my Fedora core 4 box

[~]$ python
Python 2.4.1 (#1, May 16 2005, 15:19:29)
[GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import pycups


so I guess if you are on a redhat based distro there is hope...
Sep 8 '05 #2
I am using Ubuntu. pycups seems to be not existed any more.

Mike

Sep 8 '05 #3
Mike Tammerman wrote:
I am using Ubuntu. pycups seems to be not existed any more.

Mike


Yeah as I said if you're using a redhat based distro... However you
could try getting the redhat / fedora rpm that provides pycups and
installing it? I would ask on the Ubuntu list, I know they are a very
python friendly bunch :)

Martin

Sep 8 '05 #4
djw
Mike Tammerman wrote:
Hi,

I want to get the printer list from CUPS. I found some ways using

lpstat -p and
http://localhost:631/printers

but, these ways require some parsing and I am not sure, if the parsing
works all the time. A pythonic way would be very helpful.

Thanks,
Mike


The HPLIP project (hpinkjet.sf.net) includes a basic CUPS extension
module in the src/prnt/cupsext directory. Its pretty rough, but it will
return a list of CUPS printers easily enough. I am in the process of
rewriting it in Pyrex and hope to include more complete CUPS API coverage.

-Don
Sep 8 '05 #5
Thanks, a lot, this helped me so much. It was so easy, to compile,
install and use the cupsext module.

-Mike

Sep 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Eduardo Hercos Rodrigues | last post: by
3 posts views Thread by Brian | last post: by
10 posts views Thread by krishnakant Mane | last post: by
reply views Thread by TARUN | last post: by
4 posts views Thread by Stefano | last post: by
3 posts views Thread by Antoon Pardon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.