Printing to printer

Kristian Zoerhoff kristian.zoerhoff at gmail.com
Thu Aug 11 23:34:07 EDT 2005


On 8/11/05, Steve M <steve at myplace.com> wrote:
> Kristian Zoerhoff wrote:
> 
> > On 8/11/05, Steve M <steve at myplace.com> wrote:
> >> Hello,
> >>
> >>        I'm having problems sending information from a python
> >> script to a printer. I was wondering if someone might send me
> >> in the right direction. I wasn't able to find much by Google
> >
> > Which platform? Directions will vary wildly.
> >
> Ooops, sorry forgot to mention I'm using Suse 9.0 and Python 2.3x

Assuming a local printer, you could just open the appropriate device
file (e.g. /dev/lp0) in write mode and write the text to it. Another
option would be to create a temp file, and then feed that to the lpr
or enscript commands via the subprocess module.

-- 
Kristian

kristian.zoerhoff(AT)gmail.com
zoerhoff(AT)freeshell.org



More information about the Python-list mailing list