Guest User

Untitled

a guest
Feb 9th, 2021
50
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pickle, profile
  2.  
  3.  
  4. class Item:
  5.     def __init__(self, name: str):
  6.         self.name = name
  7.  
  8.  
  9. def save_items():
  10.     items = [Item('a'), Item('b')]
  11.     with open('items.pickle', 'wb') as f:
  12.         pickle.dump(items, f)
  13.  
  14.  
  15. if __name__ == '__main__':
  16.     save_items()
  17.     #profile.run('save_items()')
RAW Paste Data