Advertisement
jabela

Lazy Report Writer

Mar 17th, 2017
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.90 KB | None | 0 0
  1. import tkinter
  2. # How can we get some random commands?
  3.  
  4. window = tkinter.Tk()
  5.  
  6. def evaluate(event):
  7.     report_name=Myentry.get()
  8.     #How can you choose a random statement?
  9.     report_detail = report_name+" is the best CS student in the world" #Put in a random choice, here
  10.     window.clipboard_append(report_detail) # This adds the statement to the clipboard. Try pasting into another app
  11.     result.configure(text =report_detail) #This changes the text
  12.  
  13. MyTitle = tkinter.Label(window, text="Lazy Report Writer",font="Helvetica 16 bold")
  14. MyTitle.pack()
  15.  
  16. #This is where you enter names
  17. Myentry = tkinter.Entry(window)
  18. Myentry.bind("<Return>", evaluate)
  19. Myentry.pack()
  20.  
  21. instruction = tkinter.Label(window, text="Enter a name and press<enter>")
  22. instruction.pack()
  23.  
  24. #This starts blank, but changes when you put in a name
  25. result = tkinter.Label(window, text="")
  26. result.pack()
  27.  
  28. window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement