python脚本使用Bash指令的一种方式

    print(name)
    print( read_content(name))
    infos.append(read_content(name))
    xml = os.path.join(dir,name)
    new_xml = new_dir +  '/' + str(count) +'.xml'


    img = xml.replace('xml','png')
    new_img = new_dir +  '/' + str(count) +'.png'

    wd = 'cp' + ' ' + xml + ' ' + new_xml
    os.system(wd)

    wd = 'cp' + ' ' + img + ' ' + new_img
    os.system(wd)
    count +=1

你可能感兴趣的:(python)