import random
class Dog(object):
_range = [1, 189]
_base_url = 'http://www.robots.ox.ac.uk/~vgg/data/pets/data/images/{}_{}.jpg'
dogs = ['shiba_inu','staffordshire_bull_terrier','shiba_inu','english_setter','great_pyrenees','leonberger','saint_bernard']
@classmethod
def today(cls):
return cls._base_url.format(random.choice(cls.dogs), random.randint(*cls._range))
print Dog.today()
Wandbox http://melpon.org/wandbox/permlink/wYVzLWuBSxpg0Fac
Downlod http://www.robots.ox.ac.uk/~vgg/data/pets/
Sample
Recommended Posts