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)