[Tutor] Python printing to LPT

ALAN GAULD alan.gauld at btinternet.com
Sat Feb 12 22:34:18 CET 2011


> to print some plain text to a dot matrix printer that the printer can handle 
> with its own internal fonts without need for any kind of other processing.    

In that case you can either open LPT1 as a file and write to it or use 
redirection to PRN from the command line.

> I am dubious about the reliability of using the MS Windows "DOS" in 
> a production environment.

We used DOS in production environments for 10 years before Windows 
took over, its not a problem for this kind of thing!

Caveat: I've only tried his from Windows 98 but I don't know of any reason 
it shouldn't work from an XP CMD prompt. If

echo "hello world" > PRN:

works then it should work from Python too.

HTH,

Alan G.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110212/061de3ed/attachment.html>


More information about the Tutor mailing list