def getScriptPath():
    return os.path.dirname(os.path.realpath(sys.argv[0]))
print('Current working directory : ', os.getcwd())
os.chdir(getScriptPath())
print('Changed working directory : ', os.getcwd())
IO Error while storing data in pickle