Python Forum
[Tkinter] scipt with apparently no errors shown, still not running
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] scipt with apparently no errors shown, still not running
#1
under is the actual script, I'm still on the learning side. I have done others before this particular one and they all executed and popped up the GUI. This one hasn't been able to run and only shows "Process finished with exit code 0".
it's on PyCharm Community Edition 2024.1.4, Python 3.12.




import tkinter as tk


class MyGUI:

    def __int__(self):

        self.root = tk.Tk()

        self.label = tk.Label(text='My message', font=('Arial', 18))
        self.label.pack(padx=10, pady=10)

        self.textbox = tk.Text(height=3)
        self.textbox.pack(padx=10, pady=10)

        self.check_state = tk.IntVar()

        self.check = tk.Checkbutton(text='State check', font=('Arial', 16), variable=self.check_state)
        self.check.pack(padx=10, pady=10)

        self.button = tk.Button(text='Show message', font=('Arial', 18), command=self.message)
        self.button.pack(padx=10, pady=10)

        self.root.mainloop()

    def message(self):
        print(self.check_state.get())


MyGUI()
Output:
Process finished with exit code 0
Reply


Messages In This Thread
scipt with apparently no errors shown, still not running - by INS - Jun-28-2024, 08:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] main GUI is not shown flash77 3 753 Feb-20-2024, 05:27 PM
Last Post: flash77
  Errors while running dash plotly code Nischitha 3 5,402 Aug-24-2017, 10:54 AM
Last Post: Larz60+
  which button should be shown gray 1 3,237 Mar-30-2017, 11:57 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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