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-18 07:25:23
python multiplayer
#some server thingy i found online. server = "" port = 5555 games = {} idCount = 0 currentPlayer = 0 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((server, port)) s.listen() print("Waiting for a connection, Server Star... 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 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