Help with a Python coding question

Emile van Sebille emile at fenx.com
Wed Jan 5 18:45:36 EST 2011


On 1/5/2011 3:12 PM kanthony at woh.rr.com said...
> I want to use Python to find all "\n" terminated
> strings in a PDF file, ideally returning string
> starting addresses.   Anyone willing to help?

pdflines = open(r'c:\shared\python_book_01.pdf').readlines()
sps = [0]
for ii in pdflines: sps.append(sps[-1]+len(ii))

Emile




More information about the Python-list mailing list