-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·33 lines (26 loc) · 748 Bytes
/
main.py
File metadata and controls
executable file
·33 lines (26 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
# Try to import Python 2 name
try:
import Tkinter as tk
# Fall back to Python 3 if import fails
except ImportError:
import tkinter as tk
class Example(tk.Frame):
def __init__(self, root):
tk.Frame.__init__(self, root)
menubar = tk.Menu(self)
fileMenu = tk.Menu(self)
recentMenu = tk.Menu(self)
menubar.add_cascade(label="File", menu=fileMenu)
for name in ("file1.txt", "file2.txt", "file3.txt"):
fileMenu.add_command(label=name)
root.configure(menu=menubar)
root.geometry("200x200")
if __name__ == "__main__":
root = tk.Tk()
Example(root)
root.mainloop()