so my question is simple, how can I write my list in a text file in a form list. (See the code bellow to understand what I mean). Thanks you
addlist.py
data = []
#List data
data.append("Test1")
data.append("Test2")
#Send list to files.
with open("newlist.txt", "w") as f:
for item in data:
f.write("%s\n" % item)
So when I run this code, it write the data in my txt files but not as a list. I want the data in a list.
newlist.txt
Test1
Test2