zoukankan      html  css  js  c++  java
  • 整合

    import glob
    import os,sys
    import shutil
    
    
    
    
    fileDir = 'F:/project/Breast/InBreast/INBreast/outimgpatch/calcification/'
    fileDir1 = 'F:/project/Breast/InBreast/INBreast/outimgpatch/nocalcification/'    #移动到新的文件夹路径
    fileDir2 = 'F:/project/Breast/InBreast/INBreast/outtxtpatch/'    #移动到新的文件夹路径
    tarDir = 'F:/project/Breast/InBreast/INBreast/outimgpatch/allcalcification/'    #源图片文件夹路径
    tarDir1 = 'F:/project/Breast/InBreast/INBreast/outimgpatch/allnocalcification/'    #源图片文件夹路径
    tarDir2 = 'F:/project/Breast/InBreast/INBreast/outimgpatch/allouttxtpatch/'    #源图片文件夹路径
    import os, random, shutil
    
    
    if __name__ == '__main__':
        txtLists = os.listdir(fileDir)  # 列出文件夹下所有的目录与文件
        for filename in txtLists:
            print(filename)
            source = fileDir + filename + '/'
            source1 = fileDir1 + filename + '/'
            source2 = fileDir2 + filename + '/'
            pathDir = os.listdir(source)  # 取图片的原始路径
            for name in pathDir:
                    shutil.copy(source + name, tarDir + name)
                    shutil.copy(source1 + name, tarDir1 + name)
                    shutil.copy(source2 + name[:-4] + '.txt', tarDir2 + name[:-4] + '.txt')
  • 相关阅读:
    c++ Knight Moves 超级升级版
    百度招聘彩蛋
    C++ 八数码问题宽搜
    c++ 动态规划(数塔)
    c++ 深度优先搜索(迷宫)
    c++ 宽搜(倒水)
    c++ matrix逆时针螺旋
    c++ 基数排序
    c++ 二分答案(解方程)
    c++ 二分答案(数组查找)
  • 原文地址:https://www.cnblogs.com/ziytong/p/11200030.html
Copyright © 2011-2022 走看看