Is there any way to pop up an option for choosing the page from which the reading will start & option for choosing the pdf file is there, I am pasting the code
import pyttsx3 as py
import PyPDF2 as pd
pdfReader = pd.PdfFileReader(open('Excel-eBook.pdf', 'rb'))
from tkinter.filedialog import *
speaker = py.init()
voices = speaker.getProperty('voices')
for voice in voices:
speaker.setProperty('voice', voice.id)
book = askopenfilename()
pdfreader = pd.PdfFileReader(book)
pages = pdfreader.numPages
for num in range(0, pages): # O is the number from where the reading will start
page = pdfreader.getPage(num)
text = page.extractText()
player = py.init()
player.say(text)
player.runAndWait()
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Is there any way to pop up an option for choosing the page from which the reading will start & option for choosing the pdf file is there, I am pasting the code
import pyttsx3 as py
import PyPDF2 as pd
pdfReader = pd.PdfFileReader(open('Excel-eBook.pdf', 'rb'))
from tkinter.filedialog import *
speaker = py.init()
voices = speaker.getProperty('voices')
for voice in voices:
speaker.setProperty('voice', voice.id)
book = askopenfilename()
pdfreader = pd.PdfFileReader(book)
pages = pdfreader.numPages
for num in range(0, pages): # O is the number from where the reading will start
page = pdfreader.getPage(num)
text = page.extractText()
player = py.init()
player.say(text)
player.runAndWait()