[Tutor] capture :LPT

Poor Yorick gp@pooryorick.com
Thu Dec 19 07:22:02 2002


You may not be able to use Python to print directly to your parallel 
port, but you could use Python to print from a file, and then use the 
os.system command to tell DOS to print the file you created.

Poor Yorick
gp@pooryorick.com

janos.juhasz@VELUX.com wrote:

>Dear Gurus,
>
>I have an ERP like program, that can't use the WINDOWS printing correctly,
>but printing nicely to DOS printers.
>My idea was to printing to the - for example - :LPT2 port, where wouldn't
>be any printer device just a a program, that could capture all the data
>sent to the printer.
>It would be a python program.
>It would filter and reshape the printing and would send it to a real print
>device on any other port.
>
>I have tried it with  p = open("LPT1:", "rb") and an infinite loop, but it
>just hung up. :(
>
>>>>p = open("LPT1:", "rb")
>>>>while 1:
>>>>
>...   print p.read(1)
>
>Is it possible under MS?
>
>Best regards,
>-----------------------
>Juhász János
>IT department
>E-Mail: janos.juhasz@VELUX.com
>
>
>
>_______________________________________________
>Tutor maillist  -  Tutor@python.org
>http://mail.python.org/mailman/listinfo/tutor
>
>