尝试通过python脚本将4个文本文件复制到文本文件中显示的多个目录中?我只是在学习python,所以请帮助,下面列出的是我到目前为止所做的但是它不起作用
import os
import shutil
import string
txtfile = [r"S:\Offences\state_jul.txt","S:\Offences\state_jun.txt","S:\Offences\state_apr.txt"]
f = open(r"D:\Scripts\Python\ArcReader_Servers.txt","r")
if f:
filepath = f.readline()
while filepath:
for i in range(len(txtfile)):
filename = txtfile[i]
print filename
shutil.copy2(filename,filepath)
filepath = f.readline()
print filepath