def save_binary(obj, path): with open(path,'wb') as f: pickle.dump(obj, f, protocol=pickle.HIGHEST_PROTOCOL)