avoid for loop calling Generator function
Arshpreet Singh
arsh840 at gmail.com
Mon Feb 22 06:15:07 EST 2016
More information about the Python-list mailing list
Mon Feb 22 06:15:07 EST 2016
- Previous message (by thread): Scipy2016: call for proposals
- Next message (by thread): avoid for loop calling Generator function
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 loop , I also tried to create another function and call read_pdf() inside that new function using yield from but I think I am missing real picture here
- Previous message (by thread): Scipy2016: call for proposals
- Next message (by thread): avoid for loop calling Generator function
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list