Skip to content
Advertisement

from tkinter import * showing SyntaxError when used inside function

Here I am using from tkinter import * inside a function and when I am running the code it is showing me a SyntaxError.

enter image description here

enter image description here

Please tell me how I can use from tkinter import * inside a function.

Advertisement

Answer

You should move the import statements to the beginning of the file, at the top. You are also importing tkinter twice.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement