1.Use AI to create a file organization tool
I am someone who has almost never written Python code before, but I want to create a small Python tool to help me organize folders. Next, I will show you how I communicated with AI, and in the end, the AI helped me generate a tool that met my expectations — it can be executed by double-clicking and can also be shared with my other friends for use.
Prompt:
Please help me generate a Python script that can automatically scan a specified folder, move different types of files (such as images, documents, videos, compressed files) into corresponding categorized folders. If the folder does not exist, please automatically create it. Also, add Chinese comments in the code and tell me how to run it.
Then the AI generated the code and said to me:
The script is ready!
You just need to:
-
Save it as file_sorter.py
-
Open the command line and enter
python file_sorter.py
-
Follow the prompt to input the folder path you want to scan
-
It will automatically help you categorize and organize everything!
If you need, I can help you generate an .exe version so you can run it by double-clicking. Do you want that?
I replied: I really need it!
Then the AI told me that after installing and packaging, an exe file would be generated in the dist directory — and sure enough, after I followed the steps, it appeared!