Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to save an object in python to disk

# Step 1
import pickle
 
config_dictionary = {'remote_hostname': 'google.com', 'remote_port': 80}
 
# Step 2
with open('config.dictionary', 'wb') as config_dictionary_file:
 
  # Step 3
  pickle.dump(config_dictionary, config_dictionary_file)
Source by www.techcoil.com #
 
PREVIOUS NEXT
Tagged: #save #object #python #disk
ADD COMMENT
Topic
Name
8+7 =