dimanche 29 avril 2018

How to save a file on macos desktop using kml in python?

I have just read some of posts on how to save a kml file on macos desktop in Python but i couldn't find the answer.I try to locate the file path but it doesn't work. my code is:

import pathlib
import simplekml

longitude = input("Enter longitude: ")
latitude = input("Enter longitude: ")

kml = simplekml.Kml()
kml.newpoint(name="Sample", coords=[(longitude, latitude)])
kml.save("~/Desktop/bura/Points.kml")

The problem starts with kml.save("~/Desktop/bura/Points.kml") it doesn't find the path and doesn't save the file.

Aucun commentaire:

Enregistrer un commentaire