Answer the question
In order to leave comments, you need to log in
How to create a .data file?
I'm learning python from the book "A Byte Python".
There is such a program
import pickle
shoplistfile = "shoplist.data"
shoplist = ["яблоки", "манго", "морковь"]
f = open(shoplistfile)
pickle.dump(shoplist, f)
f.close()
del shoplist
f = open(shoplistfile, "rb")
storedlist = pickle.load(f)
print(storedlist)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question