#!/usr/bin/python
import sys
sys.path.append('/home/sindh/.local/lib/python2.7/site-packages')
sys.path.append('/usr/lib/python2.7')
sys.path.append('/usr/lib/python2.7/plat-x86_64-linux-gnu')
sys.path.append('/usr/lib/python2.7/lib-tk')
sys.path.append('/usr/lib/python2.7/lib-old')
sys.path.append('/usr/lib/python2.7/lib-dynload')
sys.path.append('/usr/local/lib/python2.7/dist-packages')
sys.path.append('/usr/lib/python2.7/dist-packages')
import h5py
from shutil import copyfile
import os
filename = '/home/sindh/www-htdocs/pakistan_dss/DATA/ML/MODELS/Kot_Alam_Model/Sindh_Complete.p01.hdf'
#print(filename)
fsource = h5py.File(filename, 'r')
fdest = h5py.File(os.path.splitext(filename)[0] + '.tmp.hdf', 'w')
# copy attributes
for fattr in  fsource.attrs.keys() :
        fdest.attrs[fattr]= fsource.attrs.get(fattr)
# copy groups, except Results
for fg in  fsource.keys() :
        if fg != "Results" :
                fsource.copy( fg, fdest )
fdest.close()
fsource.close()
