How do you write to the printer ?

Albert Hopkins marduk at letterboxes.org
Thu Jan 8 14:07:34 EST 2009


On Wed, 2009-01-07 at 16:46 -0600, David at bag.python.org wrote:
> Can find nothing in the on-line docs or a book.
> Groping in the dark I attempted :
> 
> script24
>     import io
>     io.open('stdprn','w')          # accepted
>     stdprn.write('hello printer')   # fails  < stdprn is not defined >

You didn't specify what platform you are running on, but the first
problem I see with the above is... well stdprn is not defined.  Did you
perhaps mean:

    sdtprn = io.open('stdprn', 'w')
    stdprn.write(...)

However on a Linux system that will simply open and write to a file
called 'stdprn' in your current directory.

-a





More information about the Python-list mailing list