How to delete temp folder data using python script [closed]

2024/10/5 17:27:08

how can I create python script to delete data in temp folder in windows environment system.

Answer

you can go like this

import os
os.remove("C:\Windows\Prefetch\*.*")
os.remove("C:\Windows\Temp\*.*")
os.remove("C:\Users\Your_User_Name\AppData\Roaming\Microsoft\Windows\Recent Items*.*")
https://en.xdnf.cn/q/119903.html

Related Q&A

Save a list of objects on exit of pygame game [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.Want to improve this question? Add details and clarify the problem by editing this post.Closed 10 years ago.Improv…

Trying to make loop for a function that stops after the result is lower than a certain value

Im taking a beginner python class and part of an exercise we were given was this:The point x with the property x= sin(x)−ax+ 30 is called a fixed point of the function f(x) = sin(x)−ax+ 30. It can b…

python url extract from html

I need python regex to extract urls from html, example html code :<a href=""http://a0c5e.site.it/r"" target=_blank><font color=#808080>MailUp</font></a> <…

Regex match each character at least once [closed]

Its difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying thi…

How to cluster with K-means, when number of clusters and their sizes are known [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.Want to improve this question? Update the question so it focuses on one problem only by editing this post.Closed 1…

Converting German characters (like , etc) from Mac Roman to UTF (or similar)?

I have a CSV file which I can read in and at all works fine except for the specific German (and possibly other) characters. Ive used chardet to determine that the encoding is Mac Roman import chardetde…

Caesar cipher without knowing the Key

Hey guys if you look at my code below you will be able to see that i was able to create a program that can open a file decode the content of the file and save it into another file but i need to input t…

how to convert u\uf04a to unicode in python [duplicate]

This question already has answers here:Python unicode codepoint to unicode character(4 answers)Closed 2 years ago.I am trying to decode u\uf04a in python thus I can print it without error warnings. In …

How can I display a nxn matrix depending on users input?

For a school task I need to display a nxn matrix depending on users input: heres an example: 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0(users input: 5) And here is my code until now:n = int(inpu…

How to launch 100 workers in multiprocessing?

I am trying to use python to call my function, my_function() 100 times. Since my_function takes a while to run, I want to parallelize this process. I tried reading the docs for https://docs.python.org/…