复制代码 代码如下:
import os
def load() :
filename = os.getcwd() + r'\fromto.txt'
if os.path.isfile(filename) :
f = open(filename)
try :
lines = f.readlines()
finally :
f.close()
return lines
else :
print('请创建fromto.txt.')
input()
exit()
def display(_lines) :
linenum = 1
s = '序号 源文件 目标文件\n'
for line in _lines :
s += str(linenum) + ' ' + line
linenum += 1
return s + '\n' + r'请输入序号:'
def work(s, _lines) :
cmd = r'copy /y ' + _lines[int(s)-1]
print(cmd)
os.system(cmd)
if __name__ == "__main__" :
lines = load()
while True :
try :
s = input(display(lines)).strip()
if s.lower() == 'exit' :
break
if int(s) == 0 :
lines = load()
print('已重新加载')
continue
work(s, lines)
except :
input('--Error--')
fromto.txt的格式是每一行左边是源文件,右边是目标文件(或目标目录)。
反正其实就是包装了copy一下。
fromto.txt内容
复制代码 代码如下:
d:\txt\1.txt d:\txt\2.txt
d:\txt\*.txt d:\txt2\
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
更新日志
- 黑神话悟空上品鼠弩手精魄获取方法一览|上品鼠弩手精魄收集攻略
- 中国音乐地图听见世界非物质文化遗产《非遗HQCD》wav
- 中国民乐合奏作品集《华夏之音HQ》头版限量编号[WAV+CUE]
- [电影原声带]黎允文《天将雄师》[FLAC+CUE]
- 曝NS继任机型已进入量产阶段:已花了30亿日元
- 不是Switch2?曝《马里奥惊奇》NS捆绑包即将公开
- 暖心任天堂!网友Switch维修返还时贴纸被完好保留
- 《国语老歌 经典对唱情歌 2CD》[WAV/分轨][1.1GB]
- 《刀郎 翻唱精选华语专辑 披着羊皮的狼 》[WAV+CUE][430MB]
- 《真的田震 中国乐坛红极一时的歌者 精品集》[WAV+CUE][300MB]
- 群星.1995-新滚石九大天王之情歌大全【滚石】【WAV+CUE】
- 群星.1993-滚石九大天王十二出好戏·纵夏欢唱【滚石】【WAV+CUE】
- 群星.1993-滚石九大天王十二出好戏·贺岁齐唱【滚石】【WAV+CUE】
- 黑神话悟空上品虫校尉精魄获取方法一览|上品虫校尉精魄收集攻略
- 《指环王:夏尔的传说》推迟至2025年初发行