In pykml, I can read the first placemark in a file using the following code:
with open(filename) as f: pm = parser.parse(f).getroot().Document.Folder
This works:
with open(filename) as f: doc = parser.parse(f).getroot().Document.Folder for pm in doc.iterchildren(): if hasattr(pm, 'LineString'): print pm.LineString.coordinates