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
  • 1,398
  • 3
  • 14
  • 35

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
  • 941
  • 6
  • 22