Print to Windows default Printer

Tim Golden tim.golden at viacom-outdoor.co.uk
Thu Jan 20 04:03:17 EST 2005


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

TJG

________________________________________________________________________
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:
http://www.star.net.uk
________________________________________________________________________



More information about the Python-list mailing list