When doing the project, for convenience, always directly put the file on the desktop. For a long time, the files on the desktop are piling up. When it's time to clean up, sorting is time-consuming. Direct deletion is not reassuring, because some files may still be used.
Usually my approach is to create a new folder, move the file all the way inside, make room for the desktop, and then come back to tidy it up when it's free.
Because I often do this, repeat work. Repeat work should be done by the program. So I wrote a script with Python to achieve this simple function. The following is the source code:
#This Python file uses the following Encoding:utf-8
import OS
import shutil from
datetime import datetime
curdir = Os.curdir
# Create the folder to store the files into current directory
Dstfolder = Os.path.join (Curdi R, DateTime.Now (). Strftime ('%m-%d%h-%m '))
if not os.path.exists (dstfolder):
os.makedirs (Dstfolder)
# List and move the "file in current directory" to "folder just created
files = Os.listdir (CurDir) for
F in Files :
if Os.path.isfile (f) and F!= ' CleanDirectory.exe ':
srcpath = Os.path.join (CurDir, f)
Dstpath = Os.path . Join (Dstfolder, F)
Shutil.move (Srcpath, Dstpath)
I've made it into an EXE and can download it here.
Instructions for use:
Put the exe in a directory, double-click to run. Files in the current directory (excluding folders) are moved to a folder (the new folder is named after the current time).
I write it the main purpose is to clean the desktop, put on the desktop, run, the desktop on the removal of the files, saying refreshing.
Attention.
Do not modify the name of the EXE, can be modified to use, but the EXE will also be moved to the new folder.