Advertisement
skip420

madlibs

Jun 17th, 2022
869
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.16 KB | None | 0 0
  1. # madlibs with tkinter
  2. #python3 madlibs.py
  3.  
  4.  
  5.  
  6. from tkinter import *
  7.  
  8.  
  9. root = Tk()
  10. root.geometry('300x300')
  11. root.title('DataFlair-Mad Libs Generator')
  12. Label(root, text= 'Mad Libs Generator \n Have Fun!' , font = 'arial 20 bold').pack()
  13. Label(root, text = 'Click Any One :', font = 'arial 15 bold').place(x=40, y=80)
  14.  
  15. def madlib1():
  16.     animals= input('enter a animal name : ')
  17.     profession = input('enter a profession name: ')
  18.     cloth = input('enter a piece of cloth name: ')
  19.     things = input('enter a thing name: ')
  20.     name= input('enter a name: ')
  21.     place = input('enter a place name: ')
  22.     verb = input('enter a verb in ing form: ')
  23.     food = input('food name: ')
  24.     print('say ' + food + ', the photographer said as the camera flashed! ' + name + ' and I had gone to ' + place +' to get our photos taken on my birthday. The first photo we really wanted was a picture of us dressed as ' + animals + ' pretending to be a ' + profession + '. when we saw the second photo, it was exactly what I wanted. We both looked like ' + things + ' wearing ' + cloth + ' and ' + verb + ' --exactly what I had in mind')
  25. def madlib2():
  26.    
  27.     adjactive = input('enter adjective : ')
  28.     color = input('enter a color name : ')
  29.     thing = input('enter a thing name :')
  30.     place = input('enter a place name : ')
  31.     person= input('enter a person name : ')
  32.     adjactive1 = input('enter a adjactive : ')
  33.     insect= input('enter a insect name : ')
  34.     food = input('enter a food name : ')
  35.     verb = input('enter a verb name : ')
  36.     print('Last night I dreamed I was a ' +adjactive+ ' butterfly with ' + color+ ' splocthes that looked like '+thing+ ' .I flew to ' + place+ ' with my bestfriend and '+person+ ' who was a '+adjactive1+ ' ' +insect +' .We ate some ' +food+ ' when we got there and then decided to '+verb+ ' and the dream ended when I said-- lets ' +verb+ '.')
  37. def madlib3():
  38.     person = input('enter person name: ')
  39.     color = input('enter color : ')
  40.     foods = input('enter food name : ')
  41.     adjective = input('enter aa adjective name: ')
  42.     thing = input('enter a thing name : ')
  43.     place = input('enter place : ')
  44.     verb = input('enter verb : ')
  45.     adverb = input('enter adverb : ')
  46.     food = input('enter food name: ')
  47.     things = input('enter a thing name : ')
  48.    
  49.     print('Today we picked apple from '+person+ "'s Orchard. I had no idea there were so many different varieties of apples. I ate " +color+ ' apples straight off the tree that tested like '+foods+ '. Then there was a '+adjective+ ' apple that looked like a ' + thing + '.When our bag were full, we went on a free hay ride to '+place+ ' and back. It ended at a hay pile where we got to ' +verb+ ' ' +adverb+ '. I can hardly wait to get home and cook with the apples. We are going to make appple '+food+ ' and '+things+' pies!.')  
  50.  
  51.  
  52. Button(root, text= 'The Photographer', font ='arial 15', command= madlib1, bg = 'ghost white').place(x=60, y=120)
  53. Button(root, text= 'apple and apple', font ='arial 15', command = madlib3 , bg = 'ghost white').place(x=70, y=180)
  54. Button(root, text= 'The Butterfly', font ='arial 15', command = madlib2, bg = 'ghost white').place(x=80, y=240)
  55. root.mainloop()
  56.  
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement