There was an error while loading. Please reload this page.
1 parent 1a7a120 commit 045c353Copy full SHA for 045c353
pdf_audio_GUI.py
@@ -1,14 +1,20 @@
1
#dependencies
2
-from Tkinter import *
3
-import tkFileDialog
+# for python 3
+from tkinter import *
4
+from tkinter import filedialog
5
import PyPDF2
6
import pyttsx3
7
8
+# for python 2 uncomment the following and comment the above one
9
+# from Tkinter import *
10
+# import tkFileDialog #change tkFileDialog in line 17
11
+# import PyPDF2
12
+# import pyttsx3
13
14
15
def extract_text():
16
'''To extract text from chosen PDF file'''
- file = tkFileDialog.askopenfile(parent=root, mode='rb', title='Choose a PDF file')
17
+ file = filedialog.askopenfile(parent=root, mode='rb', title='Choose a PDF file')
18
if file != None:
19
pdfReader = PyPDF2.PdfFileReader(file)
20
global mytext
0 commit comments