Print to Windows default Printer

Tim Golden tim.golden at
Thu Jan 20 04:03:17 EST 2005

| 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...


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")



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