read list from txt file (containing the list)

PHOTO EMBED

Thu Jun 29 2023 09:45:44 GMT+0000 (Coordinated Universal Time)

Saved by @quaie #python

import ast

with open('filename.txt', 'r') as f:
    mylist = ast.literal_eval(f.read())
content_copyCOPY

https://stackoverflow.com/questions/36209980/reading-a-list-stored-in-a-text-file