Mar-27-2020, 05:50 AM
my code:

#!/usr/bin/env python import Tkinter as tk class Application(tk.Frame): def __init__(self, master=None): tk.Frame.__init__(self, master) self.grid() self.createWidgets() def createWidgets(self): self.quitButton = tk.Button(self, text='Quit', command=self.quit) self.quitButton.grid() app = Application() app.master.title('Sample application') app.mainloop()error messages
Error:"K:\PycharmProjects\Physics Grading\venv\Scripts\python.exe" "K:/PycharmProjects/Physics Grading/Tkinter.py"
Traceback (most recent call last):
File "K:/PycharmProjects/Physics Grading/Tkinter.py", line 2, in <module>
import Tkinter as tk
File "K:\PycharmProjects\Physics Grading\Tkinter.py", line 4, in <module>
class Application(tk.Frame):
AttributeError: partially initialized module 'Tkinter' has no attribute 'Frame' (most likely due to a circular import)
Process finished with exit code 1
Don't understand