Advertisement
Guest User

Untitled

a guest
Jun 29th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. from tkinter import *
  2.  
  3. root = Tk()
  4. root.title("Mad Libs")
  5.  
  6. root.geometry("500x600")
  7.  
  8. x = 0
  9.  
  10. inp = None
  11.  
  12. def mLib():
  13. global x
  14. if x == 0:
  15. lbl1["text"]="Man's Name"#1
  16. MN1 = raw_input(v.get())
  17. elif x == 1:
  18. lbl1["text"]="Occupation"#2
  19. O1 = raw_input(v.get())
  20. elif x == 2:
  21. lbl1["text"]="Noun"#3
  22. N1 = raw_input(v.get())
  23. elif x == 3:
  24. lbl1["text"]="Noun"#4
  25. N2 = raw_input(v.get())
  26. elif x == 4:
  27. lbl1["text"]="Noun"#5
  28. N3 = raw_input(v.get())
  29. elif x == 5:
  30. lbl1["text"]="Shape"#6
  31. S1 = raw_input(v.get())
  32. elif x == 6:
  33. lbl1["text"]="Man's Name"#7
  34. MN2 = raw_input(v.get())
  35. elif x == 7:
  36. lbl1["text"]="Verb"#8
  37. V1 = raw_input(v.get())
  38. elif x == 8:
  39. lbl1["text"]="Woman's Name"#9
  40. WN1 = raw_input(v.get())
  41. elif x == 9:
  42. lbl1["text"]="Body Part"#10
  43. BP1 = raw_input(v.get())
  44. elif x == 10:
  45. lbl1["text"]="Verb"#11
  46. V2 = raw_input(v.get())
  47. elif x == 11:
  48. lbl1["text"]="Noun"#12
  49. N4 = raw_input(v.get())
  50. elif x == 12:
  51. lbl1["text"]="Noun"#13
  52. N5 = raw_input(v.get())
  53. elif x == 13:
  54. lbl1["text"]="Restaurant Name"#14
  55. RN1 = raw_input(v.get())
  56. elif x == 14:
  57. lbl1["text"]="Historic Monument"#15
  58. HM1 = raw_input(v.get())
  59. elif x == 15:
  60. lbl1["text"]="Verb Ending In ED"#16
  61. V3 = raw_input(v.get())
  62. elif x == 16:
  63. lbl1["text"]="Noun"#17
  64. N6 = raw_input(v.get())
  65. elif x == 17:
  66. lbl1["text"]="Noun"#18
  67. N7 = raw_input(v.get())
  68. elif x == 18:
  69. lbl1["text"]="Noun"#19
  70. N8 = raw_input(v.get())
  71. elif x == 19:
  72. lbl1["text"]="Verb"#20
  73. V4 = raw_input(v.get())
  74. elif x == 20:
  75. lbl1["text"]="Noun"#21
  76. N9 = raw_input(v.get())
  77. elif x == 21:
  78. lbl1["text"]="Adjective"#22
  79. A1 = raw_input(v.get())
  80. elif x == 22:
  81. lbl1["text"]="Adjective"#23
  82. A2 = raw_input(v.get())
  83. elif x == 23:
  84. lbl1["text"]="Emotion"#24
  85. E1 = raw_input(v.get())
  86. elif x == 24:
  87. lbl1["text"]="Verb Ending In Ing"#25
  88. V5 = raw_input(v.get())
  89. elif x == 25:
  90. lbl1["text"]="Noun"#26
  91. N10 = raw_input(v.get())
  92. elif x == 26:
  93. lbl1["text"]="Noun"#27
  94. N11 = raw_input(v.get())
  95. elif x == 27:
  96. lbl1["text"]="Verb"#28
  97. V6 = raw_input(v.get())
  98. else:
  99. print(Para % (MN1, O1, N1, N2, N3, S1, MN2, V1, WN1, BP1, V2, N4, N5, RN1, HM1, V3, N6, N7, N8, V4, N9, A1, A2, E1, V5, N10, N11, V6))
  100.  
  101. inp = MN1, O1, N1, N2, N3, S1, MN2, V1, WN1, BP1, V2, N4, N5, RN1, HM1, V3, N6, N7, N8, V4, N9, A1, A2, E1, V5, N10, N11, V6
  102.  
  103.  
  104.  
  105. x = x+1
  106. return
  107.  
  108. Para = '''%s is a normal %s. Then, one day, a %s explodes, causing a %s to blow up, and a nearby %s erupts into a %s of flames.
  109. %s realizes that he's being chased by the government, who's trying to %s him. While on the run, he teams up with an incredibly
  110. attractive woman named %s, who has an incredible %s. She may be from the streets, but she can %s like nobody's buisness. The
  111. duo decide to turn tables on their pursuers by blowing up a %s, which triggers a chain reaction, causing the local %s, %s, and
  112. %s to explode. Then, the bad guys' helicopter gets %s by a piece of %s from when the %s exploded, and the helicopter explodes
  113. and falls onto a %s, causing it to %s, which shoots a fireball straight into the heart of %s and destroys the bad guy leader.
  114. Everything is %s and the two decide that such a %s ordeal has caused them to fall in %s with each other. They decide to celebrate
  115. by %s on the %s,and they even managed to use a %s from the beginning of the movie, to %s the whole story together.'''
  116.  
  117. print(Para % (MN1, O1, N1, N2, N3, S1, MN2, V1, WN1, BP1, V2, N4, N5, RN1, HM1, V3, N6, N7, N8, V4, N9, A1, A2, E1, V5, N10, N11, V6))
  118.  
  119.  
  120.  
  121. btn1 = Button(root,text="Enter", command=mLib)
  122. btn1.pack()
  123.  
  124. lbl1 = Label(root, text="Lab")
  125. lbl1.pack()
  126. v = Entry(root).pack()
  127.  
  128. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement