Richard Peeters wrote:
>  
> I'm new to Python and this list.
> I installed pypiwin32 , 
> and demo runs without errors.... but nothing is printing. I checked and
> nothing in cue
> Os is windows7.

It depends on your printer.  Your script works fine on my Brother laser
printer, but many laser printers don't understand raw text.  If your
printer is native Postscript, for instance, it will throw away your raw
input, because that's not a Postscript program.  Some of the cheapest
laser printers don't have any fonts at all -- they rely on a Windows
driver to turn the text into a big bitmap.  Same for the thermal label
printers.  What printer are you using?


> BTW is there a simple method to just print text (as lprint in basic)?

LPRINT was created when the computing world was a very different place. 
It relies on DOS and BIOS calls to send text to the default printer, but
that's default in the BIOS sense, meaning a parallel printer hooked up
to a parallel port on your computer.  If you don't have a parallel port
printer, then LPRINT doesn't work, either.  If you do have a parallel
port printer, you can simulate LPRINT by opening the special file "PRN"
or "LPT1" and writing to it:

    lpr = open("PRN","w")
    lpr.write( "Hello, world!" )

If you're just trying to do logging to a printer, that's tedious but not
terribly difficult in Windows.  You just have to maintain your Y
position, do TextOut calls, and end the page when it is full.  It's
usually way easier to log to a file and print it afterward using
something like Notepad.

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to