Skip to content

Instantly share code, notes, and snippets.

@nspool
Created January 4, 2020 22:09
Show Gist options
  • Save nspool/83785bc4175740accd879bd9adf17f34 to your computer and use it in GitHub Desktop.
Save nspool/83785bc4175740accd879bd9adf17f34 to your computer and use it in GitHub Desktop.
Trivial example of a TK UI in Python
#!/usr/local/bin/python3
from tkinter import *
def donothing():
filewin = Toplevel(root)
button = Button(filewin, text="Do nothing button")
root = Tk()
menubar = Menu(root)
filemenu = Menu(menubar, tearoff = 0)
filemenu.add_command(label="New", command = donothing)
menubar.add_cascade(label = "File", menu = filemenu)
root.config(menu = menubar)
root.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment