Print to Windows default Printer

Samantha samantha7395 at
Thu Jan 20 11:59:45 EST 2005

Thanks Tim,
That is exactly what I want to do.
How do I map the printer to LPT1?
"Tim Golden" <tim.golden at> wrote in message 
news:mailman.931.1106211699.22381.python-list at
> [Samantha]
> | Thanks Tim. I didn't realize it would be so difficult.
> | S
> Strictly, if all you want to do is print text and you
> have mapped LPTx: to some printer (local or network)
> then the venerable "PRINT <filename>" or "COPY <filename> LPTx:"
> may well be what you want. You can issue these via
> an os.system call from within Python, and if that serves
> the purpose, well...
> <code>
> import os
> f = open ("temp.txt", "w")
> f.write ("""I must go down to the sea again,
> To the lonely sea and the sky.
> And all I ask is a tall ship
> And a star to steer her by.
> """)
> f.close ()
> os.system ("print temp.txt")
> </code>
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> ________________________________________________________________________ 

More information about the Python-list mailing list