参考文献python - Convert set to string and vice versa - Stack Overflow
import ast
l1 = [1, 2, 3]
repr(l1) # from list to string
eval(repr(l1)) # from string to list
ast.literal_eval(repr(l1)) # from string to list
参考文献python - Convert set to string and vice versa - Stack Overflow
import ast
l1 = [1, 2, 3]
repr(l1) # from list to string
eval(repr(l1)) # from string to list
ast.literal_eval(repr(l1)) # from string to list