Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
import Tkinter
#1
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
Huh
Reply


Messages In This Thread
import Tkinter - by orestgogosha - Mar-27-2020, 05:50 AM
RE: import Tkinter - by DT2000 - Mar-27-2020, 03:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Lightbulb [Tkinter] Tkinter Class Import Module Issue AaronCatolico1 6 3,140 Sep-06-2022, 03:37 PM
Last Post: AaronCatolico1
  [Tkinter] Tkinter - I have problem after import varaible or function from aGUI to script johnjh 2 2,603 Apr-17-2020, 08:12 PM
Last Post: johnjh
  IDLE can't import Tkinter turtleman 3 8,073 Jan-17-2020, 05:34 PM
Last Post: turtleman
  [Tkinter] Top Level Window - from tkinter import * francisco_neves2020 6 4,180 Apr-23-2019, 09:27 PM
Last Post: francisco_neves2020
  tkinter import problems on mac Lux 2 6,191 Jul-30-2017, 07:14 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020