utils_35.py 352 B

123456789101112
  1. def _save_data(filename, data):
  2. """
  3. Save formatted skeleton data to a pickle file
  4. """
  5. if filename[-2:] == ".p":
  6. filename = filename
  7. else:
  8. filename = str(filename + ".p")
  9. with open(filename, 'wb') as fp:
  10. pickle.dump(data, fp, protocol=pickle.HIGHEST_PROTOCOL)
  11. print("Saved data to file: " + filename)