Is there a function in python that allows us to save a list in a txt file and keep its format?
If I have the list:
values = ['1','2','3']
can I save it to a file that contains:
'['1','2','3']'
So far I print parts of the list in the terminal and copy those in to a txt file.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…