How I Automate 5 Annoying Tasks with Python (So I Never Have to Do Them Again!)
Here’s how I use Python to automate 5 annoying tasks — so I never have to do them manually again!

LET PYTHON HANDLE THE BORING STUFF!
How I Automate 5 Annoying Tasks with Python (So I Never Have to Do Them Again!)
Let’s be real —
there are tasks we do repeatedly that drain our time and energy. Whether it’s renaming files, sorting emails, or filling out tedious reports, these small annoyances add up. As a developer, I hate wasting time on repetitive work when I know Python can do it for me.
So, I automated five of the most annoying tasks I used to do manually. Now, I never have to think about them again. Here’s how you can do the same.
1. Renaming Hundreds of Files in Seconds
Ever had a folder full of files with weird names that you needed to rename? Maybe you downloaded images with long, unreadable names or exported reports with inconsistent naming.
Manually renaming them is painful, but Python’s os
and glob
modules make it effortless.
How I Automated It
I wrote a script that renames all files in a folder based on a pattern I define.
import os
folder_path = "/Users/Aashish/Downloads"
for index, filename in enumerate(os.listdir(folder_path), start=1):
new_name = f"report_{index}.pdf"
old_path = os.path.join(folder_path, filename)
new_path = os.path.join(folder_path, new_name)
os.rename(old_path, new_path)
print("Renaming complete!")
Now, all my files are neatly named as report_1.pdf
, report_2.pdf
, etc. No more dealing with messy filenames!

2. Automatically Organizing Downloaded Files
My downloads folder used to be a chaotic mess — PDFs, images, ZIP files, and random documents all mixed together. Instead of manually sorting them, I let Python handle it.
How I Automated It
I created a script that moves files into categorized folders based on their extensions.
import os
import shutil
download_folder = "/Users/Aashish/Downloads"
destination = {
"Images": [".png", ".jpg", ".jpeg", ".gif"],
"Documents": [".pdf", ".docx", ".txt"],
"Archives": [".zip", ".rar", ".tar"],
}
for file in os.listdir(download_folder):
file_path = os.path.join(download_folder, file)
if os.path.isfile(file_path):
for folder, extensions in destination.items():
if file.endswith(tuple(extensions)):
folder_path = os.path.join(download_folder, folder)
os.makedirs(folder_path, exist_ok=True)
shutil.move(file_path, folder_path)
print("Download folder sorted!")
Now, every time I check my downloads, everything is in the right place.
Before running the script

After running the script

3. Filling Out Web Forms Automatically
I often have to fill out repetitive forms — sign-up pages, feedback surveys, or login forms. Manually entering the same details over and over is boring. So, I automated it with Selenium.
How I Automated It
Using Python’s Selenium library, I made a script to automatically fill in forms and submit them.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome()
driver.get("https://example.com/form")
driver.find_element(By.NAME, "username").send_keys("Aashish")
driver.find_element(By.NAME, "email").send_keys("aashish@example.com")
driver.find_element(By.NAME, "message").send_keys("This is an automated response!")
driver.find_element(By.NAME, "submit").click()
driver.quit()
Now, I can run this script and let Python do the typing for me!
4. Checking and Deleting Spam Emails
Spam emails clutter my inbox daily. Manually filtering them is annoying, so I automated it with Python and IMAP.
How I Automated It
I wrote a script that logs into my email and deletes emails matching spam keywords.
import imaplib
import email
EMAIL = "your_email@example.com"
PASSWORD = "your_password"
SPAM_KEYWORDS = ["lottery", "win big", "prize", "urgent action required"]
mail = imaplib.IMAP4_SSL("imap.gmail.com")
mail.login(EMAIL, PASSWORD)
mail.select("inbox")
result, data = mail.search(None, "ALL")
for num in data[0].split():
result, msg_data = mail.fetch(num, "(RFC822)")
msg = email.message_from_bytes(msg_data[0][1])
subject = msg["subject"]
if any(keyword.lower() in subject.lower() for keyword in SPAM_KEYWORDS):
mail.store(num, "+FLAGS", "\\Deleted")
mail.expunge()
mail.logout()
print("Spam emails deleted!")
Now, spam emails don’t even reach my inbox!
5. Generating Reports Without Doing Anything
I used to manually generate weekly reports by copying data into a spreadsheet and formatting it. Now, Python’s Pandas and ReportLab libraries do it for me.
How I Automated It
import pandas as pd
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas
# Sample DataFrame
data = {
"Name": ["John", "David", "Sam"],
"Sales": [2000, 3500, 2800],
"Revenue": [5000, 7000, 6200],
}
df = pd.DataFrame(data)
# Save as Excel
df.to_excel("weekly_report.xlsx", index=False)
# Generate PDF Report
pdf_file = "weekly_report.pdf"
c = canvas.Canvas(pdf_file, pagesize=letter)
c.drawString(100, 750, "Weekly Sales Report")
y = 700
for index, row in df.iterrows():
c.drawString(100, y, f"{row['Name']}: Sales - ${row['Sales']}, Revenue - ${row['Revenue']}")
y -= 30
c.save()
print("Report generated successfully!")
Now, every week, I just run the script, and my report is ready.
Final Thoughts
Automating these tasks has saved me countless hours of manual work. Python isn’t just for developers — it’s a powerful tool for making life easier.
If you find yourself repeating any task often, I highly recommend writing a script to do it for you. Trust me, once you start automating, you’ll never want to go back!
What’s the most annoying task you’d love to automate? Let me know in the comments!