Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Save a Dictionary to File in Python Using the dump Function of the pickle Module

import pickle

my_dict = { 'balls': 4, 'halles': 2, 'mango': 6, 'Grapes': 11}

with open("myDictionary.pkl", "wb") as tf:
    pickle.dump(my_dict,tf)
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #Save #Dictionary #File #Python #Using #dump #Function #pickle #Module
ADD COMMENT
Topic
Name
6+6 =