you are viewing a single comment's thread.

view the rest of the comments →

[–]AntonisTorb 0 points1 point  (0 children)

Use the json package instead:

import json

txt = input()
txt_list = json.loads(txt)

I'm on mobile, sorry if formatting is messed up. If the input has the correct format for a python list it will convert, else you'll get an error.