Re: Help with a Python coding question

2011-01-05 Thread Emile van Sebille
On 1/5/2011 6:24 PM Bubba said... Your code only shows the first 488 bytes of the file? add 'rb' to the open statement... >>> pdflines = open(r'c:\shared\python_book_01.pdf','rb').readlines() >>> sps = [0] >>> for ii in pdflines: sps.append(sps[-1]+len(ii)) Emile -- http://mail.python.

Re: Help with a Python coding question

2011-01-05 Thread Emile van Sebille
On 1/5/2011 5:55 PM Bubba said... Does this work for binary files? (Like PDFs) I don't know what you want -- pdf's are not line oriented so searching for \n's is sketchy from the get go. I figured this was homework to test something Emile -- http://mail.python.org/mailman/listinfo/py

Re: Help with a Python coding question

2011-01-05 Thread Bubba
Your code only shows the first 488 bytes of the file? -- - --- -- - Posted with NewsLeecher v4.0 Final Web @ http://www.newsleecher.com/?usenet --- - -- - -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with a Python coding question

2011-01-05 Thread Bubba
Does this work for binary files? (Like PDFs) -- - --- -- - Posted with NewsLeecher v4.0 Final Web @ http://www.newsleecher.com/?usenet --- - -- - -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with a Python coding question

2011-01-05 Thread Justin Peel
On Wed, Jan 5, 2011 at 4:45 PM, Emile van Sebille wrote: > On 1/5/2011 3:12 PM kanth...@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\p

Re: Help with a Python coding question

2011-01-05 Thread Emile van Sebille
On 1/5/2011 3:12 PM kanth...@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(sp

Help with a Python coding question

2011-01-05 Thread kanthony
I want to use Python to find all "\n" terminated strings in a PDF file, ideally returning string starting addresses. Anyone willing to help? -- - --- -- - Posted with NewsLeecher v4.0 Final Web @ http://www.newsleecher.com/?usenet --- -