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!

How I Automate 5 Annoying Tasks with Python (So I Never Have to Do Them Again!)
Photo by Julian Myles on Unsplash

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 honest — some tasks in our daily routine are just plain annoying.

As a developer, I refuse to do these tedious tasks manually when I can make Python do them for me. In this article, I’ll share five real-world tasks I’ve automated with Python — so I never have to do them again.

1. Automatically Backing Up Important Files

I work on multiple projects, and manually backing up important files is time-consuming and error-prone. Forgetting to back up a crucial file at the wrong moment? Disaster.

I use Python to automate file backups by copying my work files to a backup folder with timestamps.

import os 
import shutil 
from datetime import datetime 
 
source_folder = "C:/Users/Aashish/Documents/Work" 
backup_folder = "D:/Backups/" 
# Create a timestamped backup folder 
timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S") 
backup_path = os.path.join(backup_folder, f"backup_{timestamp}") 
os.makedirs(backup_path, exist_ok=True) 
# Copy all files 
for file in os.listdir(source_folder): 
    full_file_path = os.path.join(source_folder, file) 
    if os.path.isfile(full_file_path): 
        shutil.copy(full_file_path, backup_path) 
print(f"Backup completed at {backup_path}")
My work files are automatically backed up daily — no more worrying about data loss!

2. Scraping Data from Websites (Instead of Copy-Pasting)

I frequently need data from websites — like stock prices, news headlines, or weather updates. Manually copying and pasting this data wastes time.

So, i use Python’s BeautifulSoup and requests make web scraping simple. Here’s an example that extracts the latest news headlines from a website:

import requests # pip install requests 
from bs4 import BeautifulSoup # pip install beautifulsoup4 
 
url = "https://news.ycombinator.com/" 
response = requests.get(url) 
soup = BeautifulSoup(response.text, "html.parser") 
headlines = soup.find_all("span", class_="titleline") 
for i, headline in enumerate(headlines[:10], start=1): 
    print(f"{i}. {headline.find().text}") 
print("News fetched successfully!")
# output 
 
1. English Scientists Develop Fast, High-Quality AI Weather Model for Desktops 
2. RDNA 4's "Out-of-Order" Memory Accesses 
3. The Vatican's Latinist: On the Career of Reginald Foster. (2017) 
4. Shift-to-Middle Array: A Faster Alternative to Std:Deque? 
5. Quadlet: Running Podman containers under systemd 
6. A USB Interface to the "Mother of All Demos" Keyset 
7. Supply Chain Attacks on Linux Distributions – Fedora Pagure 
8. First Known Photographs of Living Specimens 
9. The SeL4 Microkernel: An Introduction [pdf] 
10. Show HN: My iOS app to practice sight reading (10 years in the App Store) 
News fetched successfully!
No more manually checking news sites — Python does it for me!

3. Automating Repetitive Data Entry in Excel

Manually entering or formatting Excel data is frustrating and inefficient.

Python’s pandas and openpyxl allow automating Excel tasks like formatting, data cleanup, and calculations.

import pandas as pd 
 
# Load an Excel file 
df = pd.read_excel("sales_data.xlsx") 
# Clean up column names 
df.columns = df.columns.str.strip().str.lower() 
# Fill missing values 
df.fillna(0, inplace=True) 
# Save the cleaned data 
df.to_excel("cleaned_sales_data.xlsx", index=False) 
print("Excel file cleaned and saved!")
No more wasting time cleaning Excel data — Python does it in seconds!

4. Bulk Image Resizing for Social Media

I post a lot of content on social media in Instagram and having more than (70k + followers), and resizing images manually for different platforms (Instagram, Twitter, LinkedIn) was a nightmare.

Using Pillow, I wrote a script that automatically resizes images to fit different platform requirements.

from PIL import Image 
import os 
 
input_folder = "/Users/Aashish/Pictures/" 
output_folder = "/Users/Aashish/Pictures/Resized/" 
os.makedirs(output_folder, exist_ok=True) 
sizes = {"Instagram": (1080, 1080), "Twitter": (1200, 675), "LinkedIn": (1200, 627)} 
for file in os.listdir(input_folder): 
    if file.endswith((".jpg", ".png")): 
        img = Image.open(os.path.join(input_folder, file)) 
        for platform, size in sizes.items(): 
            resized_img = img.resize(size) 
            resized_img.save(os.path.join(output_folder, f"{platform}_{file}")) 
print("Images resized successfully!")
Resizing images takes seconds, not hours.

5. Automating Password Generation & Storage

I used to create weak passwords or forget them entirely, which led to security risks and wasted time.

I wrote a Python script that generates strong passwords and saves them securely in a file.

import secrets 
import string 
 
website = "medium.com" 
def generate_password(length=16): 
    characters = string.ascii_letters + string.digits + string.punctuation 
    return "".join(secrets.choice(characters) for _ in range(length)) 
password = generate_password() 
print(f"Generated Password: {password}") 
with open("passwords.txt", "a") as f: 
    f.write(f"{website} - {password}\n") 
print("Password saved securely!")
I never struggle with passwords anymore!

Final Thoughts

Python has saved me countless hours by automating repetitive tasks. With just a few scripts, I never have to:

  • Manually back up files
  • Copy-paste data from websites
  • Clean and format Excel spreadsheets
  • Resize images for social media
  • Generate and store passwords

If you keep repeating a task, ask yourself — can Python do this for me? Chances are, the answer is YES.

What’s the most annoying task you’ve automated with Python? Let me know in the comments!

If you enjoyed this article, follow me for more Python automation tips!