Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

save variable python pickle

import pickle
  
# Create a variable
myvar = [{'This': 'is', 'Example': 2}, 'of',
         'serialisation', ['using', 'pickle']]
  
# Open a file and use dump()
with open('file.pkl', 'wb') as file:
      
    # A new file will be created
    pickle.dump(myvar, file)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #save #variable #python #pickle
ADD COMMENT
Topic
Name
8+4 =