内容涉及:路径拼接,文件拷贝,内容追加(append)

# !/usr/bin/python
# -*- coding: UTF-8 -*-
import pandas as pd
import os
import time
import scipy.misc
from shutil import copyfile
from PIL import Image
import shutil lossfile_csv = []
lossfile_img = []
for line in open("error.txt"):
csvpath = line.strip('\n')
arr = csvpath.split('/')
arr_2 = arr[3]
arr_split = arr_2.split('_')
batch_Id = arr_split[0]
Medical_Id = arr_split[1]
FOV_Id = arr_split[2]
csv_dir_path = './csv/' + batch_Id + '/' + Medical_Id + '/' + FOV_Id[:-3] + 'csv'
csv_new_path = './data_error' + '/' + batch_Id + '_' + Medical_Id + '_' + FOV_Id[:-3] + 'csv'
img_dir_path = './img/' + batch_Id + '/' + Medical_Id + '/' + 'Images/' + FOV_Id
img_new_path = './data_error' + '/' + batch_Id + '_' + Medical_Id + '_' + FOV_Id
if not os.path.exists(csv_dir_path):
print("not exit file:",csv_dir_path)
lossfile_csv.append(csv_dir_path)
continue
if not os.path.exists(img_dir_path):
print("not exit file:",img_dir_path)
lossfile_img.append(img_dir_path)
continue
shutil.copy(csv_dir_path,csv_new_path)
shutil.copy(img_dir_path,img_new_path)
print("END")

最新文章

  1. ICollection
  2. javascript 获取iframe中的dom
  3. First day on cnblogs,破壳日~~
  4. Mysql-linux下密码修改,忘记密码修改,超级管理用户修改
  5. PHP学习笔记:MySQL数据库的操纵
  6. Xamarin.Forms 现已开启对 UWP 的支持
  7. linux笔记:压缩解压命令gzip,gunzip,tar,zip,unzip,bzip2,bunzip2
  8. NewRelicAgent(CustomAnalyticEvent.cxx.o), building for iOS simulator, but linking in object file built for OSX, for architecture x8(botched)
  9. DataGuard相同SID物理Standby搭建
  10. Pyhon中的除法
  11. 怎样把redis编译为库,挪为己用?
  12. CentOS 6.5 安装realtek RTL8188CE无线网卡
  13. UITableView 自定义选中Cell颜色
  14. 安装apk程序进android
  15. POJ1613 147/思维题
  16. Linux-进程描述(2)之进程标识符进程位置与环境变量
  17. Postgres中的物化节点之sort节点
  18. Git Batch命令(转)
  19. Unity Shader Learning
  20. Object类型转换成自定义类型(向下转型)

热门文章

  1. 最好用的FTP工具,最好用的FTP工具推荐!
  2. 一文带你深入理解JVM,看完之后你还敢说你懂JVM吗?颠覆you认知
  3. Rocket - config - DefaultConfig
  4. Java实现 LeetCode 295 数据流的中位数
  5. Java实现 LeetCode 223 矩形面积
  6. PAT 月饼
  7. webpack+vue+.vue组件模板文件 所需要的包
  8. .NET Core技术研究系列-索引篇
  9. springmvc无法进入controller,且报错404
  10. 2、react-生命周期1※※※