Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Foto():
- estratto = 0
- def __init__(self, link):
- self.link = link
- def byEstratto_key(foto):
- return foto.estratto
- def randomPick(fotos = []):
- if(len(fotos) > 1):
- sorted(fotos, key = byEstratto_key)
- fotos[0].estratto += 1
- return fotos[0].link
- #iti
- dodo = [Foto('https://scontent-mxp1-1.xx.fbcdn.net/hphotos-frc3/v/t1.0-9/1964944_10200264091081487_8289592002775596944_n.jpg?oh=91c0e1d41dcd1fb55a180f196a242dea&oe=56A2A50B'),
- Foto('https://lh5.googleusercontent.com/-RtV6zxIMDO0/AAAAAAAAAAI/AAAAAAAAAGo/U7kHAP4NE-Y/photo.jpg')]
- ennio = [Foto('http://s12.postimg.org/z2qmz6li1/rsz_disperazione.jpg')]
- guru = [Foto('mantegazza')] #ADDA mantego nudo, ti mando la foto
- #unitn
- rseba = [Foto('http://disi.unitn.it/~rseba/Photos/Personale/Io/Grecia1993.jpg')]
- anny = [Foto('http://latemar.science.unitn.it/segue_userFiles/defrance/tre.jpg')]
- aletoma = [Foto('http://disi.unitn.it/~tomasi/ale.jpg')]
- occhetta = [Foto('http://i.imgur.com/rMBBqMP.jpg')]
- nonMiPiace = [Foto('http://s24.postimg.org/8anhr1yfp/nonmipiace.jpg')]
- #/b
- whoisthis = [Foto('https://upload.wikimedia.org/wikipedia/so/1/18/John-cena.jpeg')]
- landwhale = [Foto('https://pbs.twimg.com/media/CF6CWATUoAAa5jv.png')]
- #personaggi mitologici
- guastella = [Foto('https://scontent-mxp1-1.xx.fbcdn.net/hphotos-xaf1/v/t1.0-9/10410768_836906726330201_523458070976718469_n.jpg?oh=d762b68d62b29ee9669c43a20ecfc515&oe=565E01D3')]
- collo = [Foto('http://i.imgur.com/px4ghZw.jpg'),
- Foto('http://s28.postimg.org/5xfe32inh/index.jpg')]
- #ESEMPIO
- print randomPick(dodo) #restiruisce il link della foto meno estratta
- print randomPick(whoisthis) #restiruisce il link dell unica foto prensete nella lista
- #tuo nudo TheG
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement