Pets


Dowload Pets! and the packages by clicking the Download button.


Import the Pets! module in your Python script with the code:


import pets_mpm

Create pets using:


variable = pets_mpm.pet("Pet Name")

Let's look at some useful code.


import time, random
while True:
variable.talk()
time.sleep(random.randint(2, 5))
# Makes a pet continusly talk, with a 2-5 second interval.


print(variable.checkStats())
# Gives you stats about a pet.

Are you ready for all of the packages?


import pets_mpm # Import Pets!
from pets_food_package_mpm import pet_food # Import like this to prevent typing the whole name every time
from pets_home_package_mpm import pet_house
food = pet_food("dog kibble", 20, "dog", True)
pet = pets_mpm.dog("Mark", True) # Create a dog
pet.talk() # Loses a little bit of hunger
print(pet.checkStats()) # Gives you the current hunger
pet.feed(food) # Feeds the dog food
print(pet.checkStats()) # His hunger increased!
home = pet_house("Mark's house", True) # Makes a house
pet.assign(home) # Gives the pet a house
pet.move(home) # Move the pet into the house
from time import sleep # Gets the sleep() function
sleep(3) # Waits 3 seconds
pet.sleep() # Your pet sleeps in his house.