Код: Выделить всё
columns.txt
{'name': 'Well', 'id': 'Well', 'type': 'text'}
{'name': 'Type', 'id': 'Type', 'type': 'text'}
{'name': 'Pad', 'id': 'Pad', 'type': 'text'}
Код: Выделить всё
columns=[]
with open('columns.txt', 'r') as f:
for line in f:
columns.append(line.rstrip())
Код: Выделить всё
["{'name': 'Well', 'id': 'Well', 'type': 'text'}", "{'name': 'Type', 'id': 'Type', 'type': 'text'}", "{'name': 'Pad', 'id': 'Pad', 'type': 'text'}"]
Код: Выделить всё
[{'name': 'Well', 'id': 'Well', 'type': 'text'}, {'name': 'Type', 'id': 'Type', 'type': 'text'}, {'name': 'Pad', 'id': 'Pad', 'type': 'text'}]
Спасибо
Подробнее здесь: https://stackoverflow.com/questions/787 ... dictionary