A short question. I have multiple files in a tester folder on my desktop. Now I want to rewrite all those files, add 'moved' at the end of their filename and move them to a new folder named tester1 also on my desktop. Someone any idea? Thank you in advance. This is my current code:
source = r'c:\data\AS\Desktop\tester'
#Take the absolute filepaths from all the files in tester and open them.
for file in os.listdir(source):
file_paths = os.path.join(source, file)
with open(file_paths, 'r') as rf:
print(rf.read() + '\n')