Python Forum
Problem with tkinter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with tkinter
#5
(Feb-14-2018, 09:03 AM)sylas Wrote: I tried to import it.
how do you try to import it?

try to run this minimal application
import tkinter as tk

class Application(tk.Frame):
    def __init__(self, master=None):
        super().__init__(master)
        self.pack()
        self.create_widgets()

    def create_widgets(self):
        self.hi_there = tk.Button(self)
        self.hi_there["text"] = "Hello World\n(click me)"
        self.hi_there["command"] = self.say_hi
        self.hi_there.pack(side="top")

        self.quit = tk.Button(self, text="QUIT", fg="red",
                              command=root.destroy)
        self.quit.pack(side="bottom")

    def say_hi(self):
        print("hi there, everyone!")

root = tk.Tk()
app = Application(master=root)
app.mainloop()
https://docs.python.org/3/library/tkinter.html#a-simple-hello-world-program
Reply


Messages In This Thread
Problem with tkinter - by sylas - Feb-14-2018, 07:21 AM
RE: Problem with tkinter - by Gribouillis - Feb-14-2018, 07:56 AM
RE: Problem with tkinter - by buran - Feb-14-2018, 07:58 AM
RE: Problem with tkinter - by sylas - Feb-14-2018, 09:03 AM
RE: Problem with tkinter - by buran - Feb-14-2018, 11:29 AM
RE: Problem with tkinter - by Larz60+ - Feb-14-2018, 11:35 AM
RE: Problem with tkinter - by buran - Feb-14-2018, 12:01 PM
RE: Problem with tkinter - by sylas - Feb-14-2018, 12:35 PM
RE: Problem with tkinter - by buran - Feb-14-2018, 01:04 PM
RE: Problem with tkinter - by sylas - Feb-14-2018, 01:26 PM
RE: Problem with tkinter - by buran - Feb-14-2018, 02:16 PM
RE: Problem with tkinter - by sylas - Feb-14-2018, 04:28 PM
RE: Problem with tkinter - by buran - Feb-14-2018, 06:37 PM
RE: Problem with tkinter - by sylas - Feb-15-2018, 04:56 AM
RE: Problem with tkinter - by buran - Feb-15-2018, 08:49 AM
RE: Problem with tkinter - by sylas - Feb-15-2018, 09:48 PM
RE: Problem with tkinter - by sylas - Feb-16-2018, 07:30 AM
RE: Problem with tkinter - by sylas - Feb-16-2018, 12:32 PM
RE: Problem with tkinter - by buran - Feb-16-2018, 12:38 PM
RE: Problem with tkinter - by sylas - Feb-17-2018, 05:39 AM
RE: Problem with tkinter - by sparkz_alot - Feb-17-2018, 02:33 PM
RE: Problem with tkinter - by sylas - Feb-17-2018, 08:24 AM
RE: Problem with tkinter - by sylas - Feb-17-2018, 04:00 PM
RE: Problem with tkinter - by sparkz_alot - Feb-17-2018, 11:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python3 tkinter radiobutton problem Nick_tkinter 14 6,316 Feb-15-2021, 11:01 PM
Last Post: Nick_tkinter
  tkinter python button position problem Nick_tkinter 3 3,659 Jan-31-2021, 05:15 AM
Last Post: deanhystad
  [Tkinter] ClockIn/Out tkinter problem Maryan 2 2,297 Oct-12-2020, 03:42 AM
Last Post: joe_momma
  tkinter| listbox.insert problem Maryan 3 3,614 Sep-29-2020, 05:34 PM
Last Post: Yoriz
  Tkinter problem DPaul 6 4,283 May-28-2020, 03:40 PM
Last Post: DPaul
  [Tkinter] Tkinter - I have problem after import varaible or function from aGUI to script johnjh 2 2,651 Apr-17-2020, 08:12 PM
Last Post: johnjh
  [Tkinter] Problem with tkinter when creating .exe file Jan_97 2 4,696 Feb-27-2020, 05:17 PM
Last Post: Jan_97
  [Tkinter] Tkinter problem catlessness 1 2,101 Jan-15-2020, 05:17 AM
Last Post: Larz60+
  Problem with Submit button Tkinter Reldaing 2 3,735 Jan-05-2020, 01:58 AM
Last Post: balenaucigasa
  tkinter GUI, problem running seperate files fishglue 17 6,628 Oct-15-2019, 02:56 PM
Last Post: Denni

Forum Jump:

User Panel Messages

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