Essential Python Scripts for Everyday Tasks
Python is not just for developers—it’s a versatile tool that can make your daily tasks easier, faster, and smarter.
Whether you’re managing files, automating repetitive tasks, or even simplifying personal chores, Python scripts can save you time and effort.
In this article, i will cover some of the most useful Python scripts you can implement today.
These scripts are beginner-friendly yet powerful enough to impress even seasoned coders.
1. Organize Files Automatically
Tired of a cluttered downloads folder? Use this script to organize files by type—documents, images, videos, etc.—into their respective folders.
import os
import shutil
folder_path = "/path/to/your/folder"
for filename in os.listdir(folder_path):
file_ext = filename.split('.')[-1]
dest_folder = os.path.join(folder_path, file_ext)
if not os.path.exists(dest_folder):
os.makedirs(dest_folder)
shutil.move(os.path.join(folder_path, filename), os.path.join(dest_folder, filename))
2. Automate Email Sending
Send multiple emails without typing each one manually.
import smtplib
from email.mime.text import MIMEText
def send_email(subject, body, to_email):
from_email = "your_email@example.com"
password = "your_password"
msg = MIMEText(body)
msg["Subject"] = subject
msg["From"] = from_email
msg["To"] = to_email
server = smtplib.SMTP("smtp.gmail.com", 587)
server.starttls()
server.login(from_email, password)
server.sendmail(from_email, to_email, msg.as_string())
server.quit()
send_email("Daily Reminder", "Don't forget to complete your tasks!", "recipient_email@example.com")
3. Web Scraping for Quick Data
Need to extract data from a website? This script gets you started.
import requests
from bs4 import BeautifulSoup
url = "https://example.com"
response = requests.get(url)
soup = BeautifulSoup(response.content, "html.parser")
for item in soup.find_all("h2"):
print(item.text)
4. Password Generator
Generate strong, random passwords to stay secure online.