so i made a program that can convert pdf file to text bu then I make it into a gui so that its easier for a user but when it work I wasn't able to copy the text from the text box is there something wrong with my code or did I do something wrong pls help
import PyPDF2
import tkinter as tk
from tkinter import filedialog
from tkinter import *
def browseFiles():
file = filedialog.askopenfilename(initialdir = "/",title = "Select a Pdf File", filetypes = (("PDF files","*.pdf"),("all files","*.*")))
print(file)
return file
#Graphical User Interface
root = tk.Tk()
root.title('Pdf to text')
root.geometry('600x400')
#Upload pdf
tLabel = tk.Label(root, text='PDF to Text Converter')
tLabel.pack()
textFile = tk.Text(root, height=20, width=70)
textFile.config(bg='#dddddd')
textFile.pack()
button_explore = Button(root,
text = "Browse Files",
command = browseFiles,)
button_explore.pack()
button_exit = Button(root,
text = " Exit ",
command = exit)
button_exit.pack()
file = browseFiles()
pdfFileObj = open(file, "rb")
# create reader variable that will read the pdffileobj
pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
# This will store the number of pages of this pdf file
x = pdfReader.numPages
# create variable that will select the selected number of pages
# x+1 because python indentation start from 0
pageObj = pdfReader.getPage(x - 1)
# create text variable which will store all text data from pdf file
textObj = pageObj.extractText()
textFile.config(state='normal')
textFile.delete('1.0', 'end')
textFile.insert('1.0', textObj)
textFile.config(state='disabled')
root.mainloop()