parameters = {'var1': 11111111, 'path_value':
    'some/space containing path/file.txt', 'var3': 'something', 'var4': 52}
import pickle
file_name = 'parameters.pickled'
with open(file_name, 'wb') as out_file:
    pickle.dump(parameters, out_file)
How to read parameter values from a file in Python