As from a list in a text file to make the array?
I need a variable and write to a text file.
points=[(0, 5, 4, 2, 4), (1, 7, 5, 7, 6), (2, 7, 6, 0, 6), (3, 5, 3, 5, 5)]
I do it the following way:
with open('coordinates.txt','w') as file_w:
____for item in range(len(points)):
the type of the variable str points
and then I need to read this file(to pull out of the file contents), but when I get can't convert that content back into the array
asked April 3rd 20 at 18:27
Meet serialization. Want, use JSON, want pickle, you want — even msgpack. But of course, pokolesit his own :)
Find more questions by tags Python