cups.Connection.printFile

Mike Driscoll kyosohma at gmail.com
Fri Sep 26 15:48:52 CEST 2008


On Sep 19, 9:01 am, Antoon Pardon <apar... at forel.vub.ac.be> wrote:
> On 2008-09-16, Graham Jenkins <gra... at vpac.org> wrote:
>
>
>
> > I'm trying to print a file from within a Python program.
>
> > The quick-and-dirty solution is to use something like:
>
> > fd = os.popen("lp -d MyPrinter", "wb")
> > fd.write(MyFileContents)
>
> > But it seems to me that there should be a clean solution like:
>
> > import cups
> > stat =
> > cups.Connection.printFile("MyFile","MyPrinter","MyTitle","MyOptions")
>
> What about systems that don't use cups for printing?
>
> --
> Antoon Pardon

For Windows, there's a few different ways to print. Tim Golden has a
list on his website:

http://timgolden.me.uk/python/win32_how_do_i/print.html

Mike



More information about the Python-list mailing list