What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-03 14:42:58
dump data to pickle python
import pickle # take user input to take the amount of data number_of_data = int(input('Enter the number of data : ')) data = [] # take input of the data for i in range(number_of_data): raw = input('Enter data '+str(i)+' : ') data.append(raw) #... Add solution -
Python 2022-02-02 00:51:17
create pickle file python
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)... Add solution -
Python 2022-01-30 17:21:35
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, c... Add solution -
Python 2021-11-17 07:48:25
save and load a dictionary python
import pickle dictionary_data = {"a": 1, "b": 2} a_file = open("data.pkl", "wb") pickle.dump(dictionary_data, a_file) a_file.close() a_file = open("data.pkl", "rb") output = pickle.load(a_file) p... Add solution
Best helpers
Ranking is empty