abc = None
def load() :
abc = cPickle.load('a.pkl')
load()
def main(review):
print abc.predict('example')
The variable abc is still set to None. main is accessing abc many times and I don't want to load the file every time. How can I load the contents of the file once?