How is it an unmatched ")"?
How is it an unmatched ")"? Question: Consider: from tkinter import * from tkinter import filedialog def openFile(): filepath = filedialog.askopenfile() file = open(filepath), ‘r’) print(file.read()) file.close() window = Tk() button = Button(text="Open",command=openFile) button.pack() window.mainloop() Error: C:UsersHpPycharmProjectspythonProjectvenvScriptspython.exe "C:UsersHpPycharmProjectspythonProjectopen a file.py" File "C:UsersHpPycharmProjectspythonProjectopen a file.py", line 7 file = open(filepath), ‘r’) ^ SyntaxError: unmatched ‘)’ Process …