import os
Path = '/home/huacan/Pictures1/'
ImgobjectPath = '/home/huacan/VOCdevkit2/VOC2007/Annotations/'
myDir = os.listdir(Path)
for filePath in myDir:
if 0<filePath.find('_xml'):
for file in os.listdir(Path+filePath):
print(Path,filePath,file)
f = open(Path+filePath+'/'+file,'rb')
f2 = open(ImgobjectPath+'/'+file,'wb')
conten = f.read()
f2.write(conten)
f.close()
f2.close()
print(ImgobjectPath+filePath+file)