0

How do I convert string that looks like this:

['Point Target', 'Channeled']

To an actual List of elements (in this example, Point Target and Channeled)?

keddad
  • 958
  • 11
  • 27

1 Answers1

0

You could use eval("['Point Target', 'Channeled']").

But be careful if you get the list from an untrusted source as eval will evaluate everything that it gets. So don't use it e.g on unfiltered input from a webinterface.

Syrius
  • 867
  • 7
  • 18