Answer the question
In order to leave comments, you need to log in
How to save lists to a file and get them from a file?
Please tell me how to save a list like this to a file:
[('config.h', '.\\mb_config.h', '83A7A716'), ('mainCpp.cpp', '.\\mainCpp.cpp', '30FCD925')]
Answer the question
In order to leave comments, you need to log in
>>> data = [('config.h', '.\\mb_config.h', '83A7A716'), ('mainCpp.cpp', '.\\mainCpp.cpp', '30FCD925')]
>>> import pickle
>>> with open('data.pickle', 'wb') as fp:
... pickle.dump(data, fp)
...
>>> with open('data.pickle', 'rb') as fp:
... data_new = pickle.load(fp)
...
>>> data_new
[('config.h', '.\\mb_config.h', '83A7A716'), ('mainCpp.cpp', '.\\mainCpp.cpp', '30FCD925')]
Maybe csv files will help you
https://docs.python.org/3/library/csv.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question