The content of txt is as follows, which stores the file path:
#txt文档里有图片路径,将此路径下的图片复制到另一个新路径
import shutil
newpath=r'C:\Users\Desktop\test'
path = []
with open(r'C:\Users\Desktop\test.txt' ,'r') as f:
for line in f:
print(line)
shutil.copy(line.strip(), newpath) #strip()用于移除字符串头尾指定的字符(默认为空格或者换行符)或字符序列