aDistances= IN aDistancesnew=  aFlatdistancesnew =  for i in aDistances: sDistance = i if sDistance > "0": x= sDistance.split(",")[-1][:-6][10:] aDistancesnew.append(int(x))
the above script generates a list of lists, offcourse it is simple flattened with list.flatten in dynamo. But i would like to how this can be done in python:
so i added this peace of code to my script:
for sublist in aDistancesnew: for item in sublist: aFlatDistancesnew.append(item)
but than I get an error: TypeError: iteration over non-sequence of type int on the second line, so apparently i am not looping over a list but over an object instead.
what am i doing wrong?