How can I get the length of all lines with python in QGIS.
For example if I have:
How can I say, I have 23 m (example) of lines?
I found that if I click in one part of the line:
But really I wouldn't know how can I get the Length(Cartesian) or Length(Ellipsoidal) in Python.
Because I do the next code but I don't find any fields with the name "length" but in the above image I can see that inside of "Derived" There is a field.
print(features[0])
print(features[0].geometry())
lista = features[0].fields().toList()
And for example when I right click in the layer, and I open "open attribute table" I see left image, but on the other hand I show that the same line has a field "length" how you can see in the right image:


