[python-win32] printing(hardcopy) error in python in windows

vishnu mahendra vishnu_mahendra at yahoo.com
Fri Apr 25 09:43:39 EDT 2003


sir,

can you help me to print a hard copy. i am using
python2.0 in win32
using dot matrix as my default printer.i have
pythonwin too.
i searched and i got something simillar to printing
but
---------------------------------------
import win32print
def rawprint(data="hai",jobname='TEST
DOC',printerName=None):
    if printerName==None:
        printerName=win32print.GetDefaultPrinter()
    print printerName
    printerHandle=win32print.OpenPrinter(printerName)
    print printerHandle
   
printJob=win32print.StartDocPrinter(printerHandle,1,(jobname,None,None))
    print printJob
    win32print.WritePrinter(printerHandle,data)
    win32print.EndDocPrinter(printerHandle)
    win32print.ClosePrinter(printerHandle)
rawprint()
----------------------------------------
error:
    
Epson LX-300
4304748
Traceback (innermost last):
  File "d:/pro/printerfun.py", line 13, in ?
    rawprint()
  File "d:/pro/printerfun.py", line 8, in rawprint
   
printJob=win32print.StartDocPrinter(printerHandle,1,(jobname,None,None))
AttributeError: StartDocPrinter



i also gone through pythonwin help and i found
PyCPrintInfo Object.
i tried my best, i have not found how to use that
object.please help me.

thank you in advance,
vishnu

__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com



More information about the Python-win32 mailing list