Skip to content

Instantly share code, notes, and snippets.

@wynand1004
Created August 11, 2018 00:13
Show Gist options
  • Save wynand1004/8818af9a8ccd53e6efdcbab3e75e6724 to your computer and use it in GitHub Desktop.
Save wynand1004/8818af9a8ccd53e6efdcbab3e75e6724 to your computer and use it in GitHub Desktop.
A simple inspirational saying rotating app written in Python 3 and using tkinter.
# Inspirational Sayings
# By @TokyoEdTech YouTube Channel: https://www.youtube.com/channel/UC2vm-0XX5RkWCXWwtBZGOXg
import tkinter
import random
root = tkinter.Tk()
root.title("Inspiration")
root.geometry("225x75")
lbl_inspiration = tkinter.Label(root, wraplength=200)
lbl_inspiration.pack()
sayings = [
"All things are difficult before they are easy. - John Norley",
"Don't wait. The time will never be just right. - Napoleon Hill",
"Wherever you go, go with all your heart. - Confucius",
"Eighty percent of success is showing up. - Woody Allen",
"A jug fills drop by drop. - Buddha"
]
def new_inspiration():
saying = random.choice(sayings)
lbl_inspiration["text"] = saying
root.after(10000, new_inspiration)
new_inspiration()
root.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment