# main.py
spisok = ['123','456','789']
save_spisok = open('spisok.py','w')
save_spisok.write(spisok)
save_spisok.close()
import_spisok = list(open('spisok.py').read()) # не работает нормально.
# spisok.py
['123','456','789']
save_spisok = open('spisok.py','w')
save_spisok.write(spisok)
save_spisok.close()
save_spisok = open('spisok.py','r')
import_spisok = save_spisok.read()
save_spisok.close()
import pickle
def main():
array = ['123', '456', '789']
with open('data.pickle', 'wb') as file:
pickle.dump(array, file)
with open('data.pickle', 'rb') as file:
array = pickle.load(file)
print(array)
if __name__ == '__main__':
main()