【发布时间】:2014-10-21 23:52:53
【问题描述】:
我正在我的 python 脚本中创建一个 kml 文件。 然后在 google earth 中手动打开。
python 中是否有在运行时将 kml 文件加载到 google earth 的命令。
【问题讨论】:
标签: python-2.7 kml google-earth
我正在我的 python 脚本中创建一个 kml 文件。 然后在 google earth 中手动打开。
python 中是否有在运行时将 kml 文件加载到 google earth 的命令。
【问题讨论】:
标签: python-2.7 kml google-earth
os.startfile("Path to the kml file") 或 webbrowser.open("Path to the kml file") 都将在 google earth 中加载 kml 文件。但是,这需要将 kml 文件默认设置为使用 google earth 打开。
如果默认情况下 kml 文件未设置为使用 google earth 打开,os.system("Path to the GoogleEarth.exe 文件" + "path of the KML file") 将在 Google Earth 中打开它。还有其他方法可以完成此任务。
This 链接为使用各自的应用程序打开文件提供了很好的解决方案。
【讨论】: