Seven Scriptural scriptures will use weekly


Photo for Author | Ideogram
Obvious Introduction
Python It is not just data science, construction apps, or doing games. I was teaching his younger brother, Qasim, Python, and I realized that he was very connected to mysterious scriptures that would work weekly. One thing I've seen in life is a Junch of the small, unprofitable jobs, which eats time can deviate your power. You end up wearing a little motivation or focused on things actually important. Therefore, I am here to help you with some of the most common jobs you meet is about weekly and how it can easily be with Python, save time and energy.
I keep the texts clean and simple, but you can add to them for your needs. So, let's get started.
Obvious 1. Automated File Orfider for Expansion
To be honest, sometimes when I work, my download folder becomes a perfect object. I will share the simple python script that will threaten your target Directory and arrange them (eg photos, documents, videos) with extension using os including closure. Let's have a look:
import os
import shutil
from pathlib import Path
# Folder to organize (e.g., Downloads)
base_folder = Path.home() / "Downloads"
# Define folders for each extension
folders = {
"images": ["jpg", "png", "gif", "bmp"],
"documents": ["txt", "pdf", "docx"],
"archives": ["zip", "rar", "tar", "gz"],
"audio": ["mp3", "wav"],
# add more categories as needed
}
# Iterate over files in base_folder
for item in base_folder.iterdir():
if item.is_file():
ext = item.suffix.lower().lstrip('.')
moved = False
# Determine which category folder to use
for folder, ext_list in folders.items():
if ext in ext_list:
dest_dir = base_folder / folder
dest_dir.mkdir(exist_ok=True)
item.rename(dest_dir / item.name)
moved = True
break
# If extension didn’t match any category, move to "others"
if not moved:
dest_dir = base_folder / "others"
dest_dir.mkdir(exist_ok=True)
item.rename(dest_dir / item.name)
Obvious 2. System Resource Monitor with warnings
If you are a person like me using many tabs, apps, and texts together, it is easy to lose your system's operating track. This text, using disuti Library, helps you to look at your CPU and RAM use. You can even set alerts if use terminate a certain limit.
import psutil
import time
CPU_LIMIT = 80 # in percentage
MEMORY_LIMIT = 80 # in percentage
while True:
cpu = psutil.cpu_percent(interval=1)
memory = psutil.virtual_memory().percent
print(f"CPU: {cpu}%, Memory: {memory}%")
if cpu > CPU_LIMIT:
print("⚠️ CPU usage is high!")
if memory > MEMORY_LIMIT:
print("⚠️ Memory usage is high!")
time.sleep(5)
Run it for a while, and you will start to see how things go when planning videos or running the heavy script.
Obvious 3. The default email reporter
Email eats more path than we think. Whether it answers updates, sending reminders, following, or keeping people in the lake, often spend hours to do things that can work. And if there is something like me, you may be defeating what you should list in those common renewal emails, finish planning, and running to it later. This simple text can be truly helpful, and here you can put it:
import smtplib
from email.mime.text import MIMEText
sender = "[email protected]"
receiver = "[email protected]"
subject = "Daily Report"
body = "This is your automated email for today."
msg = MIMEText(body)
msg["Subject"] = subject
msg["From"] = sender
msg["To"] = receiver
# For security, use environment variables or getpass instead of hardcoding.
password = "your_password"
with smtplib.SMTP_SSL("smtp.gmail.com", 465) as server:
server.login("[email protected]", password)
server.send_message(msg)
print("Email sent!")
⚠️ Heads up: If you are using Gmail, make sure you enable secure access to the app or set the application-specific password if you have 2FA enabled.
Obvious 4. Desktop notifications
I actually started using this text to help me stick to Pomodoro plan (25 minutes of deeper focus followed by 5-minute break). And honestly, miracles worked on my torment levels and strength all day. It's good if you want something to promote a small reminder on your screen without changing applications or set the alarms. You can use it about anything such as expansion, hydration warnings, or reminding me to stop your apathy.
As I am in Macos, I use your own built-in irisplibriipt commands notifications of the traditional system. But if you're in Windows or Linux, you can use the piercing The same workbreak.
Here is how I stop my working side of work:
import time
import os
def notify(title, message):
os.system(f'''
osascript -e 'display notification "{message}" with title "{title}"'
''')
# Pomodoro session settings
work_duration = 25 * 60 # 25 minutes
break_duration = 5 * 60 # 5 minutes
cycles = 4 # Number of Pomodoro sessions
for i in range(cycles):
# Work phase
notify(f"Pomodoro {i + 1} - Focus Time", "Time to focus! Work for 25 minutes.")
time.sleep(work_duration)
# Break phase
notify("Break Time", "Nice work! Take a 5-minute break.")
time.sleep(break_duration)
# Final notification
notify("All Done!", "You’ve completed all your Pomodoros 🎉")
Obvious 5. Password Generator and manager
If you still use the same password everywhere (please choose), this is for your. It produces a secure password and stores safely (you can bring later part).
import random
import string
def generate_password(length=12):
chars = string.ascii_letters + string.digits + string.punctuation
password = "".join(random.choice(chars) for _ in range(length))
return password
new_password = generate_password()
print("Generated Password:", new_password)
# Save to file (simple way)
with open("passwords.txt", "a") as file:
file.write(f"MySite: {new_password}n")
MORE SAFETY, see confidential writing a file with Romantography or keeping it in a safe place like key ring.
Obvious 6. Search text with many files
If I work in writing, I usually have tons of green ideas scattered in all different files in different folders. Sometimes I remember writing a bright write or snippet last weeks … but I don't know where to save. This small text saved me for hours. Instead of opening all file to search the phrase “Reader” or “Vector search,” I just run this Python script I stopped checking me.
import os
search_dir = "your_directory" # Replace with the path to your notes
search_term = "machine learning"
for root, dirs, files in os.walk(search_dir):
for file in files:
if file.endswith(".txt") or file.endswith(".md"):
file_path = os.path.join(root, file)
try:
with open(file_path, "r", encoding="utf-8") as f:
content = f.read()
if search_term.lower() in content.lower():
print(f"✅ Found in: {file_path}")
except Exception as e:
print(f"❌ Skipped {file_path} (error reading file)")
This is a simple version that works well with text files are obvious. As I work with him .docx, .pptxbeside .pdf Files, using an additional advanced version supporting those structures. You can easily extend this text using libraries like Python-Docx, Python-Pptxbeside pdfplumber Making into a small search engine for your work area.
Obvious 7. Finding internships and courses in Twitter
Twitter / X can be Goldmine if you know how to use tactfully. When I was actively new of Master's and PhD bursaries, I realized that you don't just need to be appropriate, but you also need to rush and know. Many beautiful opportunities come from Twitter (yes, seriously, but quickly disappearing if you don't look close. There are two good ways to do this Spython: Used or SNSSPAPE Library or legal API of Twitter. If you want more control (such as a language sorting, without Retweetets, etc.), you can use the Twitter official API2. Or with free version, you get limited access to the latest Tweets. Through this sake script, we will use Applications library to join API and Pings to the head Editing the results.
You will need an engineer account and the carrying token (from the engineer / x portal).
import requests
import pandas as pd
BEARER_TOKEN = 'YOUR_TWITTER_BEARER_TOKEN' # Replace this with your token
headers = {
"Authorization": f"Bearer {BEARER_TOKEN}"
}
search_url = "
# Keywords that usually show up in academic opportunities
query = (
'(phd OR "phd position" OR "master position" OR "fully funded") '
'("apply now" OR "open position" OR "graduate position") '
'-is:retweet lang:en'
)
params = {
'query': query,
'max_results': 10, # Max is 100 for recent search
'tweet.fields': 'author_id,created_at,text',
'expansions': 'author_id',
'user.fields': 'username,name',
}
def get_tweets():
response = requests.get(search_url, headers=headers, params=params)
if response.status_code != 200:
raise Exception(f"Request failed: {response.status_code}, {response.text}")
return response.json()
def extract_tweet_info(data):
users = {u['id']: u for u in data.get('includes', {}).get('users', [])}
tweets_info = []
for tweet in data.get('data', []):
user = users.get(tweet['author_id'], {})
tweet_url = f"https://twitter.com/{user.get('username')}/status/{tweet['id']}"
tweets_info.append({
'Date': tweet['created_at'],
'Username': user.get('username'),
'Name': user.get('name'),
'Text': tweet['text'],
'Tweet_URL': tweet_url
})
return pd.DataFrame(tweets_info)
if __name__ == "__main__":
data = get_tweets()
df = extract_tweet_info(data)
print(df[['Date', 'Username', 'Text', 'Tweet_URL']].head())
df.to_csv('phd_masters_positions_twitter.csv', index=False)
You can use this week and save results on CSV or email you.
Obvious Rolling up
Generally, I did not start using Python with automation, but in time I realized how long we enter little, repetitive to my peace. These scriptures may be seen, but sincerely helps to free the time and head.
You don't need to change everything. Just select one or two jobs you do most common and build there. I found that once you start with simple automation, you begin to see many ways to make life easier. This is where clicks really start.
Let me know if you end up using any of this or build your versions. I would like to see if you come from you.
Kanal Mehreen Are the engineering engineer and a technological author interested in the biggest interest of data science and a medication of Ai and medication. Authorized EBOOK “that added a product with chatGPT”. As a Google scene 2022 in the Apac, it is a sign of diversity and the beauty of education. He was recognized as a Teradata variation in a Tech scholar, Mitacs Globalk scholar research, and the Harvard of Code Scholar. Kanalal is a zealous attorney for a change, who removes Femcodes to equip women to women.



