Are you still doing repetitive tasks manually?
Itβs time to automate like a boss. π€π‘
These Python scripts are small, powerful, and designed to save your time and energyβwhether you're a developer, student, freelancer, or just someone who uses a computer daily.
π 1. Bulk Rename Files in a Folder
import os
for count, filename in enumerate(os.listdir("my_folder")):
dst = f"file_{count}.txt"
os.rename(f"my_folder/{filename}", f"my_folder/{dst}")
βοΈ Renames all files to file_0.txt, file_1.txt, ...
π 2. Merge All PDFs in a Folder
import PyPDF2
import os
merger = PyPDF2.PdfMerger()
for pdf in os.listdir():
if pdf.endswith(".pdf"):
merger.append(pdf)
merger.write("merged.pdf")
merger.close()
βοΈ No more dragging PDFs into online tools. Done locally in seconds.
π 3. Extract Text from Any PDF
from PyPDF2 import PdfReader
reader = PdfReader("example.pdf")
text = ""
for page in reader.pages:
text += page.extract_text()
print(text)
βοΈ Instantly make any PDF copy-paste friendly.
πΌοΈ 4. Resize All Images in a Folder.
from PIL import Image
import os
for file in os.listdir("images"):
if file.endswith(".jpg"):
img = Image.open(f"images/{file}")
img = img.resize((800, 800))
img.save(f"images/resized_{file}")
βοΈ Resize Instagram photos, memes, or assets in bulk.
π‘ 5. Quick Notes to Markdown File.
note = input("Whatβs on your mind? ")
with open("notes.md", "a") as f:
f.write(f"- {note}\n")
βοΈ Make your own fast note-taker from the terminal.
β 6. Pomodoro Timer (25/5 Focus Cycle).
import time
def timer(minutes):
print(f"β³ Focus for {minutes} minutes!")
time.sleep(minutes * 60)
print("β
Timeβs up!")
timer(25)
timer(5)
βοΈ Boost productivity with a custom Pomodoro timer.
π 7. Generate Strong Random Passwords.
import random
import string
password = ''.join(random.choices(string.ascii_letters + string.digits, k=12))
print("π", password)
βοΈ Never reuse a weak password again.
π¬ 8. Summarize Any Text in 3 Sentences.
import nltk
nltk.download('punkt')
from nltk.tokenize import sent_tokenize
text = input("Paste your text:\n")
sentences = sent_tokenize(text)
print("\n".join(sentences[:3]))
βοΈ Quick way to get the gist of long emails or articles.
π§Ή 9. Clean Up Downloads Folder.
import os
import shutil
downloads = "C:/Users/YourName/Downloads"
for file in os.listdir(downloads):
if file.endswith(".zip"):
shutil.move(f"{downloads}/{file}", f"{downloads}/Zips/{file}")
βοΈ Automatically organizes downloaded files.
π§ 10. Daily Motivation Quote.
import requests
res = requests.get("https://zenquotes.io/api/random")
quote = res.json()[0]['q'] + " β" + res.json()[0]['a']
print(quote)
βοΈ Start the day with wisdom right from your terminal.
β‘οΈ Bonus Tip: Turn These Into One-Click Apps
Use Streamlit to turn these scripts into apps with buttons and slidersβno frontend code needed!
π Wrapping Up
Python isnβt just for AI or backend dev. Itβs your personal time-saving assistant.
Save this post, try these scripts, and let me know which one was your favorite. Or better yet β comment with your own!
π§ Want a Part 2 with 10 More Scripts?
π¬ Drop a comment or hit β€οΈ if you found this helpful!
Top comments (0)