So I'm having an issue where when I read in info from an xml file. The data it reads in is supposed to be a list of numbers but when I read it in, it comes as a string. Is there a way to read xml data as a list or a way to convert a string to a list.
Eg I get the data from the xml as say [1.0, 2.0, 3.0, 4.0, 5.0] and if I check the type it says its a string, ie the whole thing is a string including the brackets and the comma.
Can't wrap my head around how to convert this back to a list of numbers
[float(x) for x in mystring.lstrip('[').rstrip(']').strip().split(',')]eval()! Ususally I avoid it like the plague, but this might be a real application for it!)eval()command is cleaner and works in python2 and python3