On Fri, 2014-03-14 at 11:40 +0100, Ulrich Goebel wrote: > Hallo, > > is there another way to pritt a PDF form python? > > My problem is a PDF which is printed well by evince, but not with lp, > even not out of python using > > os.system("lp some_options file.pdf")
Python is deprecating os.system in favour of using the subprocess package. subprocess.call('lp some_options file.pdf', shell=True) or subprocess.call(['lp', *some_options, 'file.pdf') assuming some_options is a sequence of strings, on option per string. > Later on I have to build the PDF in a python program (using reportlab) > and then print it, even from the python program. > > So I look for a (nice documented) library which give access to the CUPS > API or something else to print the PDF from python. > > Any help is welcome! Debian Sid has packages python-cups and python-cupshelpers which are Python 2 APIs for working with CUPS. Sadly there do not seem to be Python 3 versions of these In Debian, but the package in PyPI is pycups so can be made available to Pytho 3. Also: http://cyberelk.net/tim/software/pycups/ I have not used these yet myself, but I have trying them out on my agenda for later in the spring. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor