How to read a file in python to get from directions only full distance without waypoints

I want to get from all requests to ORS only a distance value from summary starting.
And i need to put it in the file automatic. How i can do this?

I don’t understand your question.

Please have a look at the very basics of Python and you probably could use this library too: