本文整理汇总了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')
示例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')