By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,676 Members | 2,236 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,676 IT Pros & Developers. It's quick & easy.

Printer List from CUPS

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
I am using Ubuntu. pycups seems to be not existed any more.

Mike

Sep 8 '05 #3

P: n/a
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

P: n/a
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

P: n/a
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.