printer problem
Verfasst: Donnerstag 4. Oktober 2007, 19:26
Hello
Please help me - I write code to read file and send to the printer...
all works fine but printer print on page something like this:
linia1
.......linia2
..............linia3
I want:
linia1
linia2
linia3
How to fix this?
Please help me - I write code to read file and send to the printer...
Code: Alles auswählen
import win32print
f = open("C:/abc.txt","w")
f.write("linia1\n")
f.write("linia2\n")
f.write("linia3")
f.close()
y = open("C:/abc.txt","r")
ry = y.read()
y.close()
dane = ry
default_printer=win32print.GetDefaultPrinter()
hprinter = win32print.OpenPrinter(default_printer)
a = win32print.StartDocPrinter(hprinter, 1, ('Testowy wydruk', None, None))
b = win32print.WritePrinter(hprinter, dane)
c = win32print.EndDocPrinter(hprinter)
d = win32print.ClosePrinter(hprinter)
linia1
.......linia2
..............linia3
I want:
linia1
linia2
linia3
How to fix this?