I have all my intermediate output files which are irrelevant in the end directed to a common directory. My program uses all the files int he directory until my program finishes execution. How can i delete these files after my program has finished execution. I am using the function
shutil.rmtree("Files")
but it gives me the error:
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'Files\Value.json'