[Solved] string list ?

list with string numbers separated with comma

properly_split [0] =
126,3,3,0,0,0,0,0.2616086194324392,0.2616086194324392,0.261
6086194324392,0.2616086194324392,0.4910397950841697,0.4910397950841697,0.4910397
950841697,0.4910397950841697,1.0,1.0,1.0,1.0,-33.924464276447154,0.0,0.012439746
295797206,-33.7989555001879,-167.86485625699467,0.19737330997559258,-10.93776036
9203255,-335.00240616187074,1.1031748789797822,33.496529298011815,-496.287343756
5651,2.322508670290246,0.2616086194324392,0.4910397950841697,0.0,0.0,1.0

string are separated by comma here
so if i get the first element i get only = 1
not 126

is that normal ?

I could split with comma then convert to float

what is the best way to convert these to numbers ?

thanks
happy bl

import bpy

data_block =     "126,3,3,0,0,0,0, \
    0.2616086194324392,0.2616086194324392,\
    0.2616086194324392,0.2616086194324392,\
    0.491039795084169, 7,0.4910397950841697,\
    0.4910397950841697,0.4910397950841697,\
    1.0,1.0,1.0,1.0,\
    -33.924464276447154,0.0,0.012439746295797206,-33.7989555001879,\
    -167.86485625699467,0.19737330997559258,\
    -10.937760369203255,-335.00240616187074,\
    1.1031748789797822,33.496529298011815,\
    -496.2873437565651,2.322508670290246,\
    0.2616086194324392,0.4910397950841697,\
    0.0,0.0,1.0"

properly_split = []
properly_split.append(data_block)

ws = properly_split[0].split(',')
for w in ws:
    fn = float(w)
    print(fn)

taking note of this example

but by list if not like that
anyway to convert it so same then you datablock?

thanks

sorry what?