Guest User

Untitled

a guest
Feb 2nd, 2018
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. import tkinter as Tk
  2.  
  3. class Cmdwd():
  4. lyrics = [
  5. 'After the war I went back to New York',
  6. 'A-After the war I went back to New York',
  7. 'I finished up my studies and I practiced law',
  8. 'I practiced law, Burr worked next door',
  9. 'Even though we started at the very same time',
  10. 'Alexander Hamilton began to climb',
  11. 'How to account for his rise to the top?',
  12. 'Man, the man is',
  13. 'Non-stop'
  14. ]
  15. ref = 0
  16.  
  17. def __init__(self):
  18. self.root = Tk.Tk()
  19. self.root.wm_title('Non-stop')
  20. self.root.minsize(width=0, height=50)
  21. self.lyric = Tk.StringVar()
  22. self.lyric.set(self.lyrics[0])
  23. # self.message displays the lyrics
  24. self.message = Tk.Message(self.root,
  25. textvariable= self.lyric, fg= 'blue', width=400,
  26. )
  27. self.message.pack(fill='y', expand=True)
  28. # self.button displays the next button
  29. self.button = Tk.Button(self.root,
  30. text= 'Next', fg= 'red', width=10, height=3
  31. ,command = self.advance)
  32. self.button.pack()
  33. # self.text displays the song title
  34. self.text = Tk.Message(self.root,
  35. text='Hamilton, Non-stop', fg='green', width=400
  36. )
  37. self.text.pack()
  38. self.root.minsize(width=500, height=200)
  39. self.root.mainloop()
  40.  
  41.  
  42.  
  43. # this function advances the lyrics
  44. def advance(self):
  45. self.ref += 1
  46. if self.ref >= len(self.lyrics):
  47. quit()
  48. self.lyric.set(self.lyrics[self.ref])
  49.  
  50. Cmdwd()
Advertisement
Add Comment
Please, Sign In to add comment