Saving output coordinates of python in Kml File

Hello guys,

I have found all the coordinates between the first and the last at a distance of 1 m from each other of a line on GoogleEarth using python script, Now how can I save those coordinates in a kml file which I can open in google earth?

Thank you all in advance.