Python isn’t just for developers — it’s a powerful tool for saving time by automating repetitive work.
Whether you’re renaming hundreds of files, sending emails, or grabbing images from the web, Python can do it for you in just a few lines of code.
Here are three practical scripts you can start using today.
If you have a folder full of messy filenames, this script can rename them in a clean, consistent way.
import os
folder = "C:/path/to/folder"
for count, filename in enumerate(os.listdir(folder), start=1):
ext = os.path.splitext(filename)[1]
new_name = f"file_{count}{ext}"
os.rename(os.path.join(folder, filename),
os.path.join(folder, new_name))
print("Files renamed successfully!")
How it works:
file_1.jpg
, file_2.jpg
, etc.)You can use Python to send an email (via Gmail in this example).
import smtplib
from email.mime.text import MIMEText
# Email settings
sender = "youremail@gmail.com"
receiver = "recipient@example.com"
password = "yourpassword"
# Email content
msg = MIMEText("Hello! This email was sent with Python.")
msg["Subject"] = "Automated Email"
msg["From"] = sender
msg["To"] = receiver
# Send email
with smtplib.SMTP_SSL("smtp.gmail.com", 465) as server:
server.login(sender, password)
server.send_message(msg)
print("Email sent!")
Important:
.env
file.Need to grab a picture from a URL? Python can fetch and save it locally.
import requests
url = "https://example.com/image.jpg"
response = requests.get(url)
with open("downloaded_image.jpg", "wb") as file:
file.write(response.content)
print("Image downloaded successfully!")
How it works:
requests
to fetch the imageThese examples just scratch the surface.
With Python, you can also:
Automation with Python can save hours of manual work every week.
Start small — try one script — and you’ll quickly see how much easier your daily workflow becomes.