I'm trying to use a simple askopenfilename function in order to obtain the path of the required document. The problem is that I'm getting this error over and over again and it happens randomly. The function can be executed properly but eventually this error pops up.
Any idea?
The code I'm using:
from tkinter import filedialog
from tkinter import *
root = Tk()
root.filename = filedialog.askopenfilename(initialdir = "/",title =
"Select file",filetypes = (("Excel files","*.xls"),("all
files","*.*")))
print (root.filename)