What do you want to save?
Add Code snippet
New code examples
-
Python 2022-03-27 19:15:07
pkl save multiple files
# Using a list, tuple, or dict is by far the most common way to do this: import pickle PIK = "pickle.dat" data = ["A", "b", "C", "d"] with open(PIK, "wb") as f: pickle.dump(data, f) wi... Add solution -
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 -
Python 2021-10-23 03:58:10
pip pickle
#pip pip install pickle-mixin #import library import pickle Add solution
Best helpers
Zack Marotta
+5
Key_asdfg
+5
Hi-yi
+5
Zhak Maarli
+5
Nitesh
+5
Miky
+5
Moji Moji
+5
Steve Bowman
+5
Sunrise Moon
+5