Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Pickle
module as an option, if I understand correctly:
Recording:
import pickle
# An arbitrary collection of objects supported by pickle.
data = {
'a': [1, 2.0, 3, 4+6j],
'b': ("character string", b"byte string"),
'c': {None, True, False}
}
with open('data.txt', 'wb') as f:
# Pickle the 'data' dictionary using the highest protocol available.
pickle.dump(data, f, pickle.HIGHEST_PROTOCOL)
import pickle
with open('data.txt', 'rb') as f:
# The protocol version used is detected automatically, so we do not
# have to specify it.
data = pickle.load(f)
print(data)
# {'a': [1, 2.0, 3, (4+6j)], 'b': ('character string', b'byte string'), 'c': {None, True, False}}
https://www.w3schools.com/python/python_file_write.asp
Google banned?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question