0
count = 0    
with open('G:/XRAY/allnormal.txt', 'r') as openfile:
        Lines = openfile.readlines()
        for line in Lines:
             check_file = os.path.exists('G:/purexray' + '/' +  Lines[count].strip())
             if check_file == True:
                 tmp = src + '/' + str(Lines[count].strip())
                 copyfile(tmp, dst)
             count+=1

I get

PermissionError: [Errno 13] Permission denied: 'G:/normal' I use Win10

Raul Rzayev
  • 31
  • 2
  • 4
  • Does this answer your question? [PermissionError: \[Errno 13\] Permission denied](https://stackoverflow.com/questions/36434764/permissionerror-errno-13-permission-denied) – abhigyanj Nov 21 '20 at 23:06
  • `copyfile` (from `shutil`) cannot have a directory as second argument. I can only guess, but `G:\normal` looks very much like one. Use `copy` instead – Jean-François Fabre Nov 21 '20 at 23:08

0 Answers0