On Mon, Feb 22, 2016 at 8:38 AM, Arshpreet Singh wrote:
> On Monday, 22 February 2016 19:05:24 UTC+5:30, Peter Otten wrote:
>> or the slightly less convoluted
>>
>> sys.stdout.writelines(map("{}\n".format, read_pdf("book.pdf")))
>
> Actually I am using this function in Android App which is being
On Tue, Feb 23, 2016 at 2:38 AM, Arshpreet Singh wrote:
>> next(filter(print, read_pdf("book.pdf")), None)
>
> Why we are w=using filter here?
It's a beautiful hack. It'll filter according to the "print"
predicate, which always returns None, and will thus filter everything
out. One single call to
On Monday, 22 February 2016 19:05:24 UTC+5:30, Peter Otten wrote:
> Arshpreet Singh wrote:
>
> > Hi, I am converting PDF into text file, I am using following code.
> >
> > from pypdf2 import PdfFileReader
> >
> > def read_pdf(pdfFileName):
> >
> > pdf = PdfFileReader(pdfFileName)
> >
> >
Arshpreet Singh wrote:
> Hi, I am converting PDF into text file, I am using following code.
>
> from pypdf2 import PdfFileReader
>
> def read_pdf(pdfFileName):
>
> pdf = PdfFileReader(pdfFileName)
>
> yield from (pg.extractText() for pg in pdf.pages)
>
> for i in read_pdf('book.pdf'):
Hi, I am converting PDF into text file, I am using following code.
from pypdf2 import PdfFileReader
def read_pdf(pdfFileName):
pdf = PdfFileReader(pdfFileName)
yield from (pg.extractText() for pg in pdf.pages)
for i in read_pdf('book.pdf'):
print(i)
I want to avoid for