Reputation: 1
I want to move a file to another folder, but my permissions seems to be denied.
I have tried googling the problem, and although this is probably a pretty simple problem, I am not able to find solutions. I am the administrator on the system.
import os
import shutil
import re
textregex = re.compile(r'(.*).txt')
folder_files = os.listdir('D:\\progetti python\\renamedates.py\\dates')
for filename in folder_files:
txtfiles = textregex.findall(filename)
print('found some text files: ' + filename)
for file in txtfiles:
shutil.copy(f'{file}','D:\\progettipython\\renamedates.py\\newfolder')
I expect to copy my file (which is a textfile) without having my copy denied.
Upvotes: 0
Views: 98