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.

this is the input list. Actually a list with lines (distances) from geometries to another single geometry, in order to find the closest distance from any building to a pakr, or train station, or whatever.

Wouldn’t it would be easier to use Curve.Length to get the length of the line and then round to your desired accuracy rather than converting the Line to a String using String from Object and then splitting it in Python?

Lines (and arcs, bsplines, ellipses etc) are all forms of Curves so the generic actions and properties of Curves will work on Lines too. That’s why there aren’t many specific Line properties—they’re under Curve