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 = [1.3, 2.3, 4.5]
I was expecting a simple solution like list(a)
, but I cannot find anything like that.