Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter
- # How can we get some random commands?
- window = tkinter.Tk()
- def evaluate(event):
- report_name=Myentry.get()
- #How can you choose a random statement?
- report_detail = report_name+" is the best CS student in the world" #Put in a random choice, here
- window.clipboard_append(report_detail) # This adds the statement to the clipboard. Try pasting into another app
- result.configure(text =report_detail) #This changes the text
- MyTitle = tkinter.Label(window, text="Lazy Report Writer",font="Helvetica 16 bold")
- MyTitle.pack()
- #This is where you enter names
- Myentry = tkinter.Entry(window)
- Myentry.bind("<Return>", evaluate)
- Myentry.pack()
- instruction = tkinter.Label(window, text="Enter a name and press<enter>")
- instruction.pack()
- #This starts blank, but changes when you put in a name
- result = tkinter.Label(window, text="")
- result.pack()
- window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement