
4 Python Scripts I Use to Automate My Most Annoying Daily Tasks
I kept doing the same four things manually, every single week. Sorting downloaded files into folders. Writing the same types of emails. Checking if a product price had dropped. Digging text out of PDFs. So I wrote Python scripts to handle all of them. Here's what each one does — with the key parts of the code. 1. File Organizer — Sort a messy folder in one command My Downloads folder was a disaster. This script sorts everything automatically. # Organize by file type python file_organizer . py ~/ Downloads -- mode type # Preview first (no files moved) python file_organizer . py ~/ Downloads -- dry - run It maps extensions to categories automatically: FILE_TYPE_MAP = { " Images " : [ " .jpg " , " .jpeg " , " .png " , " .gif " , " .webp " ], " Documents " : [ " .pdf " , " .doc " , " .docx " , " .txt " ], " Videos " : [ " .mp4 " , " .mov " , " .avi " , " .mkv " ], " Code " : [ " .py " , " .js " , " .ts " , " .html " , " .css " ], # ... and more } You can also sort by date ( --mode date ) o
Continue reading on Dev.to Python
Opens in a new tab



