[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: Printing
From:       Peter Hansen <peter () engcorp ! com>
Date:       2004-12-22 15:28:20
Message-ID: GpmdnXNcj_AID1TcRVn-rQ () powergate ! ca
[Download RAW message or body]

Craig Ringer wrote:
> I don't have a windows box to test with - well, our NT4 server, but it
> doesn't have anything on the serial ports. I would think that one just:
> 
> printerport = open("lpt1","w")
> 
> but on my NT box that results in a file not found exception. lpt0 opens,
> but I have no idea if it works. I did a quick google search and turned
> up little, but I'm sure this has been asked before so you might want to
> try a google groups search, etc.

The above works, provided you have configured the printer
to be addressable that way.  Note that you might well want
to use binary mode ("wb") to avoid newline-mangling.

Python can open "lpt0", but that just creates a file with
that name in your current directory... there is no such
printer port.

-Peter
-- 
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic