Graham Jenkins graham at
Tue Sep 16 06:41:29 CEST 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") 

But it seems to me that there should be a clean solution like: 

import cups 
stat =

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