I have created a small python script. With that I am trying to read a txt file but my access is denied resolving to an no.13 error, here is my code:
import time
import os
destPath = 'C:\Users\PC\Desktop\New folder(13)'
for root, dirs, files in os.walk(destPath):
f=open(destPath, 'r')
.....
Based on the name, I'm guessing that
destPathis a directory, not a file. You can do aos.walkor aos.listdiron the directory, but you can'topenit for reading. You can only callopenon a file.Maybe you meant to call
openon one or more of the items fromfiles