python 3.x shutil.copy FileNotFoundError
问题 system Windows 8.1 Python 3.4 Repeatedly get FileNotFound Errno2 , attempting to copy all files in a directory. import os import shutil source = os.listdir("C:\\Users\\Chess\\events\\") for file in source : shutil.copy(file, "E:\\events\\") yields FileNotFoundError : [Errno2] No such file or directory 'aerofl03.pgn'. Although 'aerofl03.pgn' is first in the source list ['aerofl03.pgn', ...] . Same result if a line is added: for file in source : if file.endswith('.pgn') : shutil.copy(file, "E:\