Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

save list python

>>> import pickle
>>> l = [1,2,3,4]
>>> with open("test", "wb") as fp:   #Pickling
...   pickle.dump(l, fp)
... 
>>> with open("test", "rb") as fp:   # Unpickling
...   b = pickle.load(fp)
... 
>>> b
[1, 2, 3, 4]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #save #list #python
ADD COMMENT
Topic
Name
2+7 =