删除一个文件

删除一个文件
发布日期: 2016-10-06 更新日期: 1970-01-01 编辑:yubiao 浏览次数: 2405

 from osgeo import ogr
import os

DriverName = "ESRI Shapefile"      # e.g.: GeoJSON, ESRI Shapefile
FileName = 'test.shp'
driver = ogr.GetDriverByName(DriverName)
if os.path.exists(FileName):
     driver.DeleteDataSource(FileName)
说明:

删除一个文件