cups.Connection.printFile

Graham Jenkins graham at vpac.org
Tue Sep 16 00:41:29 EDT 2008


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") 

Unfortunately, I can't get this to work; not sure of the syntax and have
no idea of what to put for "MyOptions". 

So, can anybody help with an example please? 

Also .. does anybody know of a way to print a String in this fashion
rather than a File? 

Regards ..

-- 
Graham Jenkins
Australian Research Collaboration Service
Victorian Partnership for Advanced Computing
(+613) 9925-4862





More information about the Python-list mailing list