>>> import ast
>>> ast.literal_eval('[[0,0,0], [0,0,1], [1,1,0]]')
[[0, 0, 0], [0, 0, 1], [1, 1, 0]]
For tuples
>>> ast.literal_eval('[(0,0,0), (0,0,1), (1,1,0)]')
[(0, 0, 0), (0, 0, 1), (1, 1, 0)]
More Related Contents:
- how to unpack a tuple in this form (‘abc’, [20, 20])? [closed]
- How to sort a list/tuple of lists/tuples by the element at a given index?
- What’s the difference between lists and tuples?
- Sort a list of tuples by 2nd item (integer value) [duplicate]
- Why can’t I use a list as a dict key in python?
- Are tuples more efficient than lists in Python?
- Why can tuples contain mutable items?
- How to convert comma-delimited string to list in Python?
- List vs tuple, when to use each? [duplicate]
- a mutable type inside an immutable container
- Convert tuple to list and back
- Unpacking a list / tuple of pairs into two lists / tuples
- Accessing a value in a tuple that is in a list
- Explicitly select items from a list or tuple
- How to convert a list to a list of tuples?
- Converting a list of tuples into a dict
- Transform “list of tuples” into a flat list or a matrix
- How to compare a list of lists/sets in python?
- Tuple or list when using ‘in’ in an ‘if’ clause?
- Find an element in a list of tuples
- How to convert list of tuples to multiple lists?
- How to convert nested list of lists into a list of tuples in python 3.3?
- List of Tuples to DataFrame Conversion [duplicate]
- Convert a columns of string to list in pandas
- Why can’t I use a list as a dict key in python? Exactly what can and cannot be used, and why?
- Does Python have an immutable list?
- Swap values in a tuple/list inside a list in python?
- python – get list of tuples first index?
- Filter a list of tuples based on condition
- In what case would I use a tuple as a dictionary key? [closed]