class Foo(object):

    def __init__(self, bar):
        self.bar = bar
if os.path.exists('foo.pickle'):
    with open('foo.pickle') as f:
        foo = pickle.load(f)
else:
    pass
Python: how to share an object instance across multiple invocations of a script