''' Created on Mar 13, 2014 @author: Brett Paufler Copyright Brett Paufler ''' import random import pickle ''' This is the call function Update this call function with better implementation in future ''' def runLogic(): return pickRandomGallery() ''' Picks a random gallery from appended file First iteration of logic ''' def pickRandomGallery(): print "pickRandomGallery(): called" with open (".\\imgur\\rollingGalleryData.txt", 'r') as rollingGalleryDataFile: galleryData = pickle.load(rollingGalleryDataFile) print len(galleryData) pickThisNum = random.randint(0,len(galleryData)) pickThisObject = galleryData[pickThisNum] print repr(pickThisObject) print "pickRandomGallery(): returned the above object" return pickThisObject def downVote(x): print "No downVote Function yet" #button Call def upVote(x): print "No upVote Function Yet" def savePicture(x): print "No Save Picture Function Yet" ''' TODO better methodology than random random & decrement weight Then get trickier '''