Snippets tagged “literal-eval”
1 snippet uses this tag.
- How to convert string representation of list to a listPython
You can use the ast.literal_eval() function from the ast module to safely evaluate a string and convert it to a list.
1 snippet uses this tag.
You can use the ast.literal_eval() function from the ast module to safely evaluate a string and convert it to a list.