当前位置: 首页>>代码示例>>Python>>正文


Python uf.copytree函数代码示例

本文整理汇总了Python中uf.copytree函数的典型用法代码示例。如果您正苦于以下问题:Python copytree函数的具体用法?Python copytree怎么用?Python copytree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了copytree函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1:

from __future__ import with_statement
import os, csv, shutil, tarfile, uf, dcm_ops

dest_root = "/ifs/scratch/pimri/soccog/test_working"
dst_path_lst = ["7432", "run1M1"]
uf.buildtree(dest_root, dst_path_lst)
uf.copytree(
    "/ifs/scratch/pimri/soccog/old/SocCog_Raw_Data_By_Exam_Number/2480/e1331017/s1342840_5610_1M1_s13",
    "/ifs/scratch/pimri/soccog/test_working/7432/run1M1",
)
t = tarfile.open(os.path.join("/ifs/scratch/pimri/soccog/test_working/7432/run1M1", "MRDC_files.tar.gz"), "r")
t.extractall("/ifs/scratch/pimri/soccog/test_working/7432/run1M1")
for f in os.listdir("/ifs/scratch/pimri/soccog/test_working/7432/run1M1"):
    if "MRDC" in f and "gz" not in f:
        old = os.path.join("/ifs/scratch/pimri/soccog/test_working/7432/run1M1", f)
        new = os.path.join("/ifs/scratch/pimri/soccog/test_working/7432/run1M1", f + ".dcm")
        os.rename(old, new)
qsub_cnv_out = dcm_ops.cnv_dcm(
    "/ifs/scratch/pimri/soccog/test_working/7432/run1M1",
    "7432_run1M1",
    "/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cnv",
)
# qsub_cln_out = dcm_ops.cnv_dcm('/ifs/scratch/pimri/soccog/test_working/7432/run1M1', '7432_run1M1', '/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cln')
开发者ID:nyspisoccog,项目名称:ks_scripts,代码行数:23,代码来源:p7432_run1M1.py

示例2:

from __future__ import with_statement
import os, csv, shutil,tarfile, uf, dcm_ops
dest_root = '/ifs/scratch/pimri/soccog/test_working'
dst_path_lst = ['7659', 'run2L3']
uf.buildtree(dest_root, dst_path_lst)
uf.copytree('/ifs/scratch/pimri/soccog/old/SocCog_Raw_Data_By_Exam_Number/3240/E3240_e1826369/s1879741_1904_2L3_s23', '/ifs/scratch/pimri/soccog/test_working/7659/run2L3')
t = tarfile.open(os.path.join('/ifs/scratch/pimri/soccog/test_working/7659/run2L3','MRDC_files.tar.gz'), 'r')
t.extractall('/ifs/scratch/pimri/soccog/test_working/7659/run2L3')
for f in os.listdir('/ifs/scratch/pimri/soccog/test_working/7659/run2L3'):
   if 'MRDC' in f and 'gz' not in f:
       old = os.path.join('/ifs/scratch/pimri/soccog/test_working/7659/run2L3', f)
       new = os.path.join('/ifs/scratch/pimri/soccog/test_working/7659/run2L3', f + '.dcm')
       os.rename(old, new)
qsub_cnv_out = dcm_ops.cnv_dcm('/ifs/scratch/pimri/soccog/test_working/7659/run2L3', '7659_run2L3', '/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cnv')
#qsub_cln_out = dcm_ops.cnv_dcm('/ifs/scratch/pimri/soccog/test_working/7659/run2L3', '7659_run2L3', '/ifs/scratch/pimri/soccog/scripts/mastersort/scripts_dir/cln')
开发者ID:nyspisoccog,项目名称:ks_scripts,代码行数:15,代码来源:p7659_run2L3.py


注:本文中的uf.copytree函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。