How do you write to the printer ?

Albert Hopkins marduk at
Thu Jan 8 20:07:34 CET 2009

On Wed, 2009-01-07 at 16:46 -0600, David at wrote:
> Can find nothing in the on-line docs or a book.
> Groping in the dark I attempted :
> script24
>     import io
>'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 ='stdprn', 'w')

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


More information about the Python-list mailing list