daily pastebin goal
36%
SHARE
TWEET

Untitled

a guest Dec 14th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Pet:    
  2. def __init__(self, name, hunger=0, boredom=0, tiredness=0, sickness=False,
  3.              age=0, waste=0):
  4.     self.__name = name
  5.     self.hunger = hunger
  6.     self.boredom = boredom
  7.     self.tiredness = tiredness
  8.     self.sickness = sickness
  9.     self.age = age
  10.     self.waste = waste
  11.     self.choice = choice
  12.  
  13. class Action(Pet):
  14.     def __init__(self, name):
  15.         Pet.__init__(self, name, hunger=0, boredom=0, tiredness=0,
  16.                  sickness=False, age=0, waste=0)
  17.         self.name = name
  18.  
  19.     def display(self):
  20.         print("------------")
  21.         print("hunger", self.hunger)
  22.         print("boredom", self.boredom)
  23.         print("tiredness", self.tiredness)
  24.         print("sickness", self.sickness)
  25.         print("age", self.age)
  26. class Window(Frame):
  27.     def openmenu(self):
  28.         petname = self.petnameEntry.get()
  29.         user_pet = Action(petname)
  30.         print("I am your pet,", petname)
  31.         window = tk.Toplevel(root)
  32.         w = Label(window, text="What would you like to do?")
  33.         w.pack()
  34.  
  35.         btFeed = Button(window, text="Feed", command=lambda: user_pet.eat())
  36.         btFeed.pack(pady=3)
  37.         btPlay = Button(window, text="Play", command=lambda:
  38.         user_pet.play())
  39.         btPlay.pack(pady=3)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top