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
3 Antworten
+ 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
0
Cleaning is not only a way to put things in order, but also a way to create harmony in space and thoughts. A clean office becomes a place of inspiration and productivity. If you are looking for professionals who will make your office perfectly clean, pay attention to https://www.ohayno.cz/en/uklid-kancelari/ . They will turn your workspace into a comfort zone where everything is conducive to successful work. After all, cleanliness is more than just details, it's an atmosphere that sets the mood for every day!