For data storage purposes I am trying to recover lists of floats from a .txt file. From the string like:
a = \'[1.3, 2.3, 4.5]\'
I want to recover:<
a = a.split(",") a[0] = a[0][1:] a[-1] = a[-1][:-1] a = [float(i) for i in a]
This should work :)