March 6th, 2005, 11:42 AM
how tos on printing from python
I'm looking for how to's on printing from a python program. I want to out put data from my program to avery lables. Thanks for any help.
March 6th, 2005, 02:12 PM
If you're using a *nix like system then you could use the Python program to lay out the text and then pipe the output to the printer. This isn't a very a very Pythonic or portable solution but it is by far the easiest way I can think of .
The only other way I can think of would be to use Mark Hammonds Win32 extensions – assuming that Windows has an API for accessing the printer . It may also be possible to use the PySerial module to talk to the printer.
But I've never actually seen this done.
Hope this is of some help,
March 6th, 2005, 02:16 PM
So maybe it's best to output to a text file?
Maybe it's best to output to a text file then print?
March 6th, 2005, 03:20 PM
If your not running *nix then that could be a good idea. If you are then it makes little difference which you choose . In fact on *nix I would probably go with printing the text to stdout.
March 6th, 2005, 05:17 PM
you could use some of the wxPython tools. I will try to find what i read, but it will let you print whatever. There was anouther one with wxPython that will work by turning something to html then printing witch is very easy also. i will look for it.
Comments on this post
March 6th, 2005, 07:57 PM
Thanks for you help
Actually I use linux, but It will eventually run I windows. If I can get good at this stuff. Thanks again for all the help.