Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pickle a dictionary

import pickle #credits to stack overflow user= blender

a = {'hello': 'world'}

with open('filename.pkl', 'wb') as handle:
    pickle.dump(a, handle, protocol=pickle.HIGHEST_PROTOCOL)

with open('filename.pkl', 'rb') as handle:
    b = pickle.load(handle)

print (a == b)
Comment

PREVIOUS NEXT
Code Example
Python :: how to change windows icon tkinter 
Python :: divide by zero error python exception handling 
Python :: convert column to datetime format python 
Python :: how to install mediapipe python 
Python :: plot keras model 
Python :: python easter eggs 
Python :: unzip file python 
Python :: python regex flags 
Python :: get current date in python 
Python :: pandas update with condition 
Python :: python windows hide files 
Python :: python read csv into array 
Python :: python press key to break 
Python :: Flask Gmail 
Python :: python read file line by line 
Python :: search code ascii python 
Python :: matplotlib clear plot 
Python :: blank lines with csv.writer 
Python :: python string argument without an encoding 
Python :: numpy install wtih conda 
Python :: tkiner border 
Python :: python add month datetime 
Python :: python initialize multidimensional list 
Python :: open image in numpy 
Python :: python get date file last modified 
Python :: how to count docx pages python 
Python :: python 2 decimal places 
Python :: tqdm for jupyter notebook 
Python :: python time using timeit module 
Python :: pandas change dtype to string 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =