Python Forum
[Tkinter] [Very Basic Example Only] Hello World
Thread Rating:
  • 5 Vote(s) - 3.8 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] [Very Basic Example Only] Hello World
#1
try:
    # For Python 2.x
    import Tkinter as tk
except ImportError:
    # For Python 3.x
    import tkinter as tk

app_win = tk.Tk()
app_win.title('Hello World')
app_frame = tk.Frame(app_win)
app_win.mainloop()
Reply
#2
I don't understand the app_ prefix. This has (almost) nothing to do with this post... it's used everywhere. Obviously it's your app, why would you need to remind yourself of that. Wouldn't it make more sense, and be easier to read, if the variables were simply "win" and "frame"?
Reply
#3
They are just variable names you can name then however you like :) , this is just code by wuf copied from the old forum
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [WxPython] [Very Basic Example Only] Hello World Yoriz 5 4,150 Oct-08-2016, 06:33 PM
Last Post: Yoriz

Forum Jump:

User Panel Messages

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