0
I want to automate the process of cleaning temporary files using python script. What should i do first?
The whole process: Open Run -> Search %temp% Select all files Delete Repeat this every two hours
2 Answers
+ 2
For everything related to OS operations, use the 'os' library:
https://docs.python.org/3/library/os.html
For running something between intervals, use the function 'sleep' from the 'time' library:
https://docs.python.org/3/library/time.html?highlight=sleep#time.sleep
+ 1
you can just try: iterate over the entire folder and on error pass the file. since there are always files that cant be deleted from temp.
modules needed: os and time