CodeCuriosity

One snippet at a time. Join us for tips & tricks

Follow publication

Member-only story

20 Python Scripts To Automate Your Daily Tasks

Neuro Bytes
CodeCuriosity
Published in
5 min readOct 29, 2024

Python is a powerful tool for automating repetitive tasks, it helps you save time, reduce errors, and focus on more important work, being a lazy developer pays off sometimes. lets get to it!

1. Bulk File Renamer

Rename multiple files in a folder by specifying the prefix, suffix, or pattern.

import os
for i, filename in enumerate(os.listdir("path/to/folder")):
os.rename(filename, f"renamed_file_{i}.txt")

2. Email Sender

Send an email automatically using Python’s smtplib.

import smtplib
from email.message import EmailMessage

msg = EmailMessage()
msg.set_content("Hello! This is an automated email.")
msg["Subject"] = "Automated Email"
msg["From"] = "you@example.com"
msg["To"] = "recipient@example.com"
with smtplib.SMTP_SSL("smtp.example.com", 465) as smtp:
smtp.login("you@example.com", "your_password")
smtp.send_message(msg)

3. File Organizer

Organize files in a directory by their extensions.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

CodeCuriosity
CodeCuriosity

Published in CodeCuriosity

One snippet at a time. Join us for tips & tricks

Neuro Bytes
Neuro Bytes

Written by Neuro Bytes

Azure Cloud Engineer 📊 | Machine Learning enthusiast 🤖 | Python 🐍📈 | SQL | PLSQL #DataScience #DevOps

Responses (1)

Write a response