DeveloperBreeze

Python Automation Development Tutorials, Guides & Insights

Unlock 4+ expert-curated python automation tutorials, real-world code snippets, and modern dev strategies. From fundamentals to advanced topics, boost your python automation skills on DeveloperBreeze.

I Made $10,000 from a Simple Python Script—Here’s How!

I Made $10,000 from a Simple Python Script—Here’s How!

Article February 11, 2025
python

So I built a simple Python script that could scrape data from websites and save it in a CSV file. No fancy interface, no complex setup—just a straightforward tool that did the job.

I kept it simple and used:

Build a Facial Recognition Attendance System

Tutorial December 10, 2024
python

Use the face_recognition library to encode faces from the dataset. This step creates unique numerical representations for each face.

import os
import face_recognition
import cv2
import pickle

# Path to dataset
DATASET_PATH = "dataset"
ENCODINGS_FILE = "encodings.pickle"

def encode_faces():
    known_encodings = []
    known_names = []

    # Iterate through each person's folder
    for person in os.listdir(DATASET_PATH):
        person_path = os.path.join(DATASET_PATH, person)
        if not os.path.isdir(person_path):
            continue

        # Process each image
        for img_file in os.listdir(person_path):
            img_path = os.path.join(person_path, img_file)
            image = face_recognition.load_image_file(img_path)
            face_encodings = face_recognition.face_encodings(image)

            if face_encodings:
                known_encodings.append(face_encodings[0])
                known_names.append(person)

    # Save encodings to a file
    with open(ENCODINGS_FILE, "wb") as f:
        pickle.dump({"encodings": known_encodings, "names": known_names}, f)

    print("Encodings saved!")

encode_faces()

Building a Web Scraper to Track Product Prices and Send Alerts

Tutorial December 10, 2024
python

DESIRED_PRICE = 50.0

def check_price():
    product, price = get_product_price()
    if price <= DESIRED_PRICE:
        print(f"Price drop alert! {product} is now ${price}")
        send_email_alert(product, price)
    else:
        print(f"{product} is still above your desired price: ${price}")

Use the smtplib library to send email notifications when the price drops below the threshold.

Automating Excel Reports with Python and OpenPyXL

Tutorial December 10, 2024
python

We’ll highlight products with total sales greater than 4000 in green.

from openpyxl.formatting.rule import CellIsRule
from openpyxl.styles import PatternFill

# Define the fill color
green_fill = PatternFill(start_color='C6EFCE', end_color='C6EFCE', fill_type='solid')

# Add conditional formatting
sheet.conditional_formatting.add(
    'E2:E100',
    CellIsRule(operator='greaterThan', formula=['4000'], fill=green_fill)
)

# Save the workbook
workbook.save('sales_report_highlighted.xlsx')