0

试图通过 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
4

0 回答 0