G
Graham Jenkins
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 ..
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 ..