def copy_datasource(source_fn, target_fn):
    ds = ogr.Open(source_fn, 0)
    if ds is None:
        raise OSError('Could not open {0} for copying.'.format(source_fn))
    if os.path.exists(target_fn):
        ds.GetDriver().DeleteDataSource(target_fn)
    ds.GetDriver().CopyDataSource(ds, target_fn)
Copy an ogr data source.
dataset/ETHPy150Open cgarrard/osgeopy-code/ospybook/ospybook/__init__.py/copy_datasource