Tuesday, September 15, 2026

How to Monitor Websites Automatically with Python

 

How to Monitor Websites Automatically with Python

Websites change constantly. Prices are updated, product pages are modified, news headlines appear, job listings are added, and important announcements can be published without warning. Checking these changes manually can be time-consuming.

Python makes it possible to build a simple website monitoring system that regularly checks a webpage and alerts you when something changes. With a few libraries, even beginners can create a useful monitoring script.

What Is Website Monitoring?

Website monitoring means automatically checking a website or webpage at regular intervals and detecting changes.

For example, you could monitor:

  • A product price
  • A job listing
  • A news page
  • A blog post
  • A website's availability
  • A particular piece of text
  • A public announcement
  • Changes to HTML content

Instead of opening the website repeatedly, Python can perform these checks for you.

How Python Can Monitor a Website

A basic monitoring program follows this process:

Website → Download page → Extract information → Compare with previous result → Detect change → Send notification

Python provides several libraries that make this process relatively straightforward.

For a simple monitor, you can use:

  • requests — downloads webpage content
  • BeautifulSoup — extracts information from HTML
  • hashlib — creates a fingerprint of content
  • time — waits between checks
  • smtplib or a notification service — sends alerts

Installing the Required Libraries

First, install the two commonly used packages:

pip install requests beautifulsoup4

Then create a Python file such as:

website_monitor.py

A Simple Website Change Monitor

Here is a basic example that checks whether the content of a webpage has changed:

import requests
import hashlib
import time

URL = "https://example.com"

def get_page_hash():
    response = requests.get(
        URL,
        timeout=10,
        headers={"User-Agent": "Mozilla/5.0"}
    )

    response.raise_for_status()

    content = response.text
    return hashlib.sha256(content.encode("utf-8")).hexdigest()


old_hash = get_page_hash()

print("Monitoring started...")

while True:
    time.sleep(300)  # Check every 5 minutes

    try:
        new_hash = get_page_hash()

        if new_hash != old_hash:
            print("Website has changed!")
            old_hash = new_hash
        else:
            print("No changes detected.")

    except requests.RequestException as error:
        print("Unable to check website:", error)

The program downloads the webpage and creates a SHA-256 hash from its HTML. If the hash changes during the next check, the program reports that the page has changed.

Why Use a Hash?

Comparing an entire webpage every time can be inconvenient. A hash provides a compact representation of the content.

For example:

Webpage content
       ↓
SHA-256
       ↓
a8f4...9c21

If even a small part of the input changes, the resulting hash will normally be different.

This makes hashes useful for detecting whether a downloaded document or webpage has changed.

Monitoring Only a Specific Part of a Website

Sometimes you don't care about the entire webpage.

Imagine you want to monitor only a product price:

<div class="price">₹49,999</div>

Using BeautifulSoup, you can extract that particular element.

import requests
from bs4 import BeautifulSoup

URL = "https://example.com/product"

response = requests.get(
    URL,
    timeout=10,
    headers={"User-Agent": "Mozilla/5.0"}
)

response.raise_for_status()

soup = BeautifulSoup(response.text, "html.parser")

price = soup.select_one(".price")

if price:
    print("Current price:", price.get_text(strip=True))

Now the monitoring system can compare the price rather than the complete webpage.

Building a Price Change Detector

The next step is to remember the previous value.

import requests
from bs4 import BeautifulSoup
import time

URL = "https://example.com/product"

def get_price():
    response = requests.get(
        URL,
        timeout=10,
        headers={"User-Agent": "Mozilla/5.0"}
    )

    response.raise_for_status()

    soup = BeautifulSoup(response.text, "html.parser")
    element = soup.select_one(".price")

    return element.get_text(strip=True) if element else None


old_price = get_price()

print("Initial price:", old_price)

while True:
    time.sleep(300)

    try:
        new_price = get_price()

        if new_price != old_price:
            print("Price changed!")
            print("Old:", old_price)
            print("New:", new_price)

            old_price = new_price
        else:
            print("Price has not changed.")

    except requests.RequestException as error:
        print("Error:", error)

This example can form the foundation of a much larger monitoring application.

Sending an Alert

Printing a message in the terminal is useful for testing, but a monitoring system becomes much more useful when it sends a notification.

For example, you could connect your Python program to:

  • Email
  • Telegram
  • Discord
  • Slack
  • A custom notification API

The basic workflow becomes:

Website changes
      ↓
Python detects change
      ↓
Notification function
      ↓
Your phone/email

A notification function might look like this:

def send_alert(message):
    print("ALERT:", message)

You can later replace this function with an email or messaging API.

Monitoring Multiple Websites

Python can also monitor several pages.

websites = {
    "News": "https://example.com/news",
    "Blog": "https://example.com/blog",
    "Jobs": "https://example.com/jobs"
}

for name, url in websites.items():
    print("Checking:", name)

    response = requests.get(
        url,
        timeout=10,
        headers={"User-Agent": "Mozilla/5.0"}
    )

    print(response.status_code)

For a larger application, you could store the websites in a JSON file or database.

For example:

[
    {
        "name": "News",
        "url": "https://example.com/news"
    },
    {
        "name": "Jobs",
        "url": "https://example.com/jobs"
    }
]

This makes adding new websites easier without changing the Python program.

Using SQLite for Persistent Monitoring

A more advanced monitor should remember previous results even after the program closes.

Python includes SQLite support through the built-in sqlite3 module.

You could store:

  • Website URL
  • Last checked time
  • Previous content hash
  • Last detected change
  • Monitoring status

A simplified database structure might look like:

websites
-------------------------
id
name
url
content_hash
last_checked

This turns a small script into the foundation of a real monitoring service.

Handling Websites That Use JavaScript

One important limitation is that requests downloads the server's response but does not behave like a normal browser.

Some websites generate their content using JavaScript.

In such cases, BeautifulSoup may not find the information you're looking for because the desired content isn't present in the initial HTML.

For websites that require browser rendering, tools such as Playwright or Selenium can be used.

A browser-based workflow looks like:

Python
  ↓
Automated browser
  ↓
Load JavaScript
  ↓
Rendered webpage
  ↓
Extract information
  ↓
Compare with previous result

However, browser automation requires more resources than a simple requests-based monitor.

Important Monitoring Practices

Website monitoring should be performed responsibly.

Before monitoring a website, check its terms of service and robots.txt where applicable. Avoid sending excessive requests because frequent automated requests can put unnecessary load on a server.

A good monitoring application should:

  • Use reasonable intervals
  • Set request timeouts
  • Handle errors
  • Identify itself appropriately where appropriate
  • Avoid bypassing authentication or access controls
  • Respect website terms and applicable laws
  • Cache information when possible

For many tasks, checking every few minutes or even every hour is sufficient.

Turning the Script Into a Background Service

Once your monitor works, you don't necessarily need to keep a terminal window open manually.

On Linux, you can use:

cron

On Windows, you can use:

Task Scheduler

You can also deploy the monitoring program to a server or cloud environment.

Another approach is to use Python's scheduling libraries to execute monitoring jobs at predefined intervals.

Taking the Project Further

A basic website monitor can evolve into a complete application.

You could build a dashboard using Flask, FastAPI, or Django.

The dashboard could display:

Website Monitor
--------------------------------
Website       Status     Last Check

News          Changed    10:30 PM
Jobs          Stable     10:29 PM
Product       Changed    10:28 PM
Blog          Stable     10:27 PM

You could also add:

  • User accounts
  • Website categories
  • Custom CSS selectors
  • Change history
  • Email notifications
  • Telegram notifications
  • Scheduling
  • Database storage
  • Dashboard charts
  • Automatic screenshots
  • Failure alerts
  • Multiple monitoring frequencies

Conclusion

Python provides a practical way to automate website monitoring without building a complicated system from scratch. A simple combination of requests, BeautifulSoup and hashing can detect basic webpage changes, while tools such as Playwright can handle more dynamic websites.

The most important idea is to monitor only the information you actually need. Instead of repeatedly comparing an entire webpage, extracting a specific price, headline, status, or section usually produces cleaner and more useful results.

With persistent storage and notifications, a small Python script can eventually become a powerful website monitoring platform that works continuously in the background.

Mastering Complex Roots of Unity with Python


Mastering Complex Roots of Unity with Python

Complex numbers can look intimidating at first, especially when equations involve imaginary values. However, Python makes it much easier to experiment with complex mathematics and understand what is happening behind the equations.

One particularly interesting topic is roots of unity. They connect complex numbers with geometry, trigonometry, algebra, and computer science.

In this tutorial, we will learn what roots of unity are, understand the formulas in simple copyable form, and create Python programs to calculate, verify, and visualize them.

What Are Roots of Unity?

A root of unity is a complex number that satisfies an equation of the form:

z^n = 1

Here, n is a positive integer.

For example, consider:

z^2 = 1

The two solutions are:

z = 1
z = -1

Therefore, 1 and -1 are the second roots of unity.

If we consider:

z^3 = 1

there are three solutions. One is the familiar number 1, while the other two are complex numbers.

In general, the equation:

z^n = 1

has exactly n different complex roots.

The Formula for Roots of Unity

The roots can be calculated using the following formula:

z_k = e^(2*pi*i*k/n)

where:

k = 0, 1, 2, ..., n-1

Using Euler's formula, the same expression can be written as:

z_k = cos(2*pi*k/n) + i*sin(2*pi*k/n)

This second form is particularly useful when we want to understand the real and imaginary parts of each root.

Here:

i = sqrt(-1)

Python uses j instead of i for the imaginary unit.

Understanding the Unit Circle

Roots of unity have an interesting geometric property.

Every root lies on a circle with radius 1, called the unit circle.

The general form is:

z = cos(theta) + i*sin(theta)

The distance of this point from the origin is always 1.

The roots are evenly distributed around the circle. This means that if there are 4 roots, they form a square. If there are 5 roots, they form a pentagon. If there are 8 roots, they form an octagon.

This gives us a beautiful connection between algebra and geometry.

Complex Numbers in Python

Python supports complex numbers directly.

For example:

z = 3 + 4j

print(z)

Output:

(3+4j)

Python uses j instead of the mathematical i.

You can also access the real and imaginary parts:

z = 3 + 4j

print("Real part:", z.real)
print("Imaginary part:", z.imag)

Output:

Real part: 3.0
Imaginary part: 4.0

This built-in support makes Python convenient for experimenting with roots of unity.

Calculating Roots of Unity with Python

Python's cmath module provides mathematical functions for complex numbers.

Here is a simple program:

import cmath
import math

n = 5

for k in range(n):
    angle = 2 * math.pi * k / n
    root = cmath.exp(1j * angle)

    print(root)

This program calculates the five roots satisfying:

z^5 = 1

The values may be displayed as decimal approximations because computers work with floating-point numbers.

Calculating Roots Using Sine and Cosine

We can also implement the mathematical formula directly.

import math

def roots_of_unity(n):
    roots = []

    for k in range(n):
        angle = 2 * math.pi * k / n

        real = math.cos(angle)
        imaginary = math.sin(angle)

        root = complex(real, imaginary)

        roots.append(root)

    return roots


roots = roots_of_unity(6)

for root in roots:
    print(root)

This approach is useful because it clearly shows the relationship between the mathematical formula and the Python program.

The important part is:

angle = 2*pi*k/n

Then:

real = cos(angle)
imaginary = sin(angle)

Finally, Python combines the two components into a complex number.

Example: Cube Roots of Unity

Let's solve:

z^3 = 1

There are three roots.

The formula is:

z_k = e^(2*pi*i*k/3)

For the three values of k:

k = 0, 1, 2

the roots are:

z0 = 1
z1 = -1/2 + (sqrt(3)/2)i
z2 = -1/2 - (sqrt(3)/2)i

Python can calculate them:

import cmath
import math

n = 3

for k in range(n):
    angle = 2 * math.pi * k / n
    root = cmath.exp(1j * angle)

    print(root)

The output will be decimal approximations of the three roots.

Verifying the Roots

We can ask Python to check whether each calculated root actually satisfies:

z^n = 1

For example:

import cmath
import math

n = 5

for k in range(n):
    angle = 2 * math.pi * k / n
    root = cmath.exp(1j * angle)

    result = root ** n

    print("Root:", root)
    print("Root raised to n:", result)
    print()

The second result should be extremely close to:

1 + 0j

This confirms that the calculated values are roots of the equation.

Why Does Python Sometimes Show Tiny Errors?

You might see something like:

(1-2.4492935982947064e-16j)

instead of:

1+0j

This is caused by floating-point precision.

Mathematically:

2.4492935982947064e-16

is extremely close to zero.

Therefore, we should not normally compare floating-point complex numbers using an exact equality test.

Instead, we can use a small tolerance:

if abs(root ** n - 1) < 1e-10:
    print("Valid root")

This allows for tiny numerical errors.

Finding a Specific Root

Sometimes we don't need all the roots. We may want a particular root.

We can create a function:

import cmath
import math

def find_root(n, k):
    angle = 2 * math.pi * k / n
    return cmath.exp(1j * angle)


root = find_root(10, 3)

print(root)

Here:

n = 10

means we are calculating tenth roots of unity.

The value:

k = 3

selects the fourth root in the sequence because Python starts counting from zero.

Building an Interactive Root Calculator

We can turn the idea into a small Python project.

import cmath
import math

def calculate_roots(n):
    if n <= 0:
        raise ValueError("n must be positive")

    roots = []

    for k in range(n):
        angle = 2 * math.pi * k / n
        root = cmath.exp(1j * angle)
        roots.append(root)

    return roots


n = int(input("Enter the value of n: "))

roots = calculate_roots(n)

print(f"\nRoots of z^{n} = 1\n")

for index, root in enumerate(roots):
    print(f"Root {index}: {root}")

If the user enters:

Enter the value of n: 4

the program calculates the four roots of:

z^4 = 1

These are:

1
i
-1
-i

Understanding the Fourth Roots

The fourth roots of unity are particularly easy to visualize.

The equation is:

z^4 = 1

The four solutions are:

z0 = 1
z1 = i
z2 = -1
z3 = -i

They are positioned at 90-degree intervals around the unit circle.

The angles are:

0 degrees
90 degrees
180 degrees
270 degrees

This creates a square.

Visualizing Roots with Python

A graph can make the concept much easier to understand.

We can use Matplotlib to plot the roots.

First install it if necessary:

pip install matplotlib

Then use:

import cmath
import math
import matplotlib.pyplot as plt

n = 8

roots = [
    cmath.exp(2j * math.pi * k / n)
    for k in range(n)
]

x = [root.real for root in roots]
y = [root.imag for root in roots]

plt.scatter(x, y)

plt.axhline(0)
plt.axvline(0)

plt.xlabel("Real")
plt.ylabel("Imaginary")
plt.title(f"{n}th Roots of Unity")

plt.axis("equal")
plt.grid(True)

plt.show()

For:

n = 8

the eight points form a regular octagon.

Try changing the value:

n = 3

You will get a triangle.

Try:

n = 6

and you will get a hexagon.

A Useful Property of Roots of Unity

There is another elegant way to represent the roots.

Let:

omega = e^(2*pi*i/n)

Then all the roots can be represented as:

1
omega
omega^2
omega^3
...
omega^(n-1)

The most important property is:

omega^n = 1

This means that after raising omega to the nth power, we return to 1.

Python can demonstrate this:

import cmath
import math

n = 5

omega = cmath.exp(2j * math.pi / n)

for k in range(n + 1):
    print(k, omega ** k)

The final value will be approximately 1.

Calculating the Magnitude

Every root of unity has magnitude 1.

Python allows us to calculate the magnitude using abs().

import cmath
import math

n = 6

for k in range(n):
    angle = 2 * math.pi * k / n
    root = cmath.exp(1j * angle)

    print("Root:", root)
    print("Magnitude:", abs(root))

The magnitude should be approximately:

1.0

for every root.

This confirms the geometric fact that all the roots lie on the unit circle.

Calculating the Angle

Python's cmath.phase() function can be used to find the angle of a complex number.

import cmath

z = 1 + 1j

angle = cmath.phase(z)

print("Angle in radians:", angle)

The result is expressed in radians.

For roots of unity, these angles are evenly distributed around the circle.

Applications of Roots of Unity

Roots of unity have applications far beyond classroom mathematics.

Fourier Analysis

Roots of unity are fundamental to the Discrete Fourier Transform, which is used to break signals into their frequency components.

The Fast Fourier Transform, commonly known as FFT, makes these calculations much faster and is widely used in computing.

Digital Signal Processing

Audio, images, communication systems, and other digital signals can be analyzed using Fourier-based methods.

Computer Graphics

Complex numbers can represent rotations in two-dimensional mathematics. This makes them useful in certain graphics and geometric calculations.

Polynomial Equations

Roots of unity provide useful examples for understanding complex polynomial equations and their solutions.

Number Theory

Roots of unity also appear in advanced topics involving algebra, modular arithmetic, and number theory.

Complete Python Project

Here is a complete version that calculates and verifies the roots:

import cmath
import math

def roots_of_unity(n):
    roots = []

    for k in range(n):
        angle = 2 * math.pi * k / n
        root = cmath.exp(1j * angle)

        roots.append(root)

    return roots


n = int(input("Enter a positive integer: "))

if n <= 0:
    print("Please enter a positive integer.")
else:
    roots = roots_of_unity(n)

    print(f"\nRoots of z^{n} = 1\n")

    for k, root in enumerate(roots):
        result = root ** n

        print(f"Root {k}: {root}")
        print(f"Verification: {result}")
        print()

This small project combines several important Python concepts:

  • Functions
  • Lists
  • Loops
  • User input
  • Complex numbers
  • Mathematical calculations
  • Error checking
  • Numerical verification

Final Thoughts

Complex roots of unity are a great example of how programming can make advanced mathematics easier to explore.

The central equation is:

z^n = 1

and the general solution is:

z_k = e^(2*pi*i*k/n)

or, using sine and cosine:

z_k = cos(2*pi*k/n) + i*sin(2*pi*k/n)

Python allows us to calculate these values, verify that they satisfy the original equation, and plot them on the unit circle.

The most interesting part is the connection between algebra and geometry. Although the roots come from solving an equation, they form a perfectly regular polygon when plotted.

Once you are comfortable with roots of unity, you can go further into complex-number programming, Fourier transforms, FFT algorithms, signal processing, and other areas where mathematics and Python come together.

AI Engineer Roadmap with Python: From Beginner to Job-Ready

 

AI Engineer Roadmap with Python: From Beginner to Job-Ready

Artificial intelligence has moved from research laboratories into everyday products. Search engines, recommendation systems, chatbots, document tools, coding assistants, autonomous systems, and business applications increasingly rely on AI.

This growth has created strong demand for people who can turn AI models into useful software. That is where the AI engineer comes in.

Python is one of the best languages for entering this field because it has a huge ecosystem covering machine learning, deep learning, data processing, APIs, automation, and generative AI.

But becoming an AI engineer is not simply about learning Python or using an AI API. You need to understand programming, mathematics, data, machine learning, software engineering, deployment, and modern AI systems.

This roadmap explains a practical path from beginner to advanced AI engineer.

What Does an AI Engineer Do?

An AI engineer builds software that uses artificial intelligence to solve real-world problems.

Typical responsibilities include:

  • Preparing and processing data
  • Training machine learning models
  • Evaluating model performance
  • Building AI-powered applications
  • Working with large language models
  • Creating AI agents
  • Developing APIs
  • Connecting models to databases
  • Deploying AI applications
  • Monitoring AI systems
  • Improving performance and reliability

For example, an AI engineer might build:

User
  ↓
Web or Mobile Application
  ↓
Python Backend
  ↓
AI Model
  ↓
Database / Vector Database
  ↓
Response
  ↓
User

The exact architecture depends on the application, but the AI engineer often works across several of these layers.

Why Learn Python for AI Engineering?

Python has become one of the most widely used programming languages for artificial intelligence.

Its biggest advantage is its ecosystem.

Important Python libraries include:

NumPy
Pandas
Matplotlib
Scikit-learn
PyTorch
TensorFlow
Transformers
FastAPI
Flask

Python is also widely used for data processing, experimentation, automation, APIs, and machine learning infrastructure.

However, don't make the mistake of thinking that you need to learn every Python library.

Start with the language itself and gradually introduce libraries when a project requires them.

Step 1: Learn Python Fundamentals

The first stage is becoming comfortable with Python.

You should understand:

  • Variables
  • Data types
  • Strings
  • Numbers
  • Lists
  • Tuples
  • Sets
  • Dictionaries
  • Conditions
  • Loops
  • Functions
  • Modules
  • Exceptions
  • File handling

For example:

name = "AI Engineer"

for i in range(3):
    print("Learning Python:", name)

You should be able to understand what this program does without relying entirely on an AI assistant.

That level of independence becomes increasingly important as your projects become more complicated.

Step 2: Learn Object-Oriented Programming

After learning the basics, move into object-oriented programming.

Learn:

  • Classes
  • Objects
  • Constructors
  • Methods
  • Inheritance
  • Encapsulation
  • Polymorphism

A simple example:

class AIModel:
    def __init__(self, name):
        self.name = name

    def predict(self, text):
        return f"{self.name} processed: {text}"


model = AIModel("Demo Model")

print(model.predict("Hello AI"))

You don't need to become an OOP expert immediately, but you should understand how larger Python applications are organized.

Step 3: Learn Git and Software Development

AI engineering is software engineering with an AI component.

Therefore, learn Git early.

Important concepts include:

git init
git add
git commit
git branch
git merge
git pull
git push

You should also understand:

  • GitHub
  • Virtual environments
  • Package management
  • Environment variables
  • Debugging
  • Logging
  • Testing
  • Code organization

A good AI engineer doesn't simply create a model that works once. They build software that can be maintained and improved.

Step 4: Learn Mathematics for AI

You don't need to become a mathematician before starting AI.

However, mathematics becomes increasingly important as you progress.

Focus on:

Linear Algebra

Learn:

Vectors
Matrices
Matrix multiplication
Dot products
Eigenvalues
Eigenvectors

Probability

Understand:

Probability
Random variables
Distributions
Expected value
Variance
Conditional probability

Statistics

Learn:

Mean
Median
Standard deviation
Correlation
Sampling
Hypothesis testing

Calculus

Understand:

Derivatives
Partial derivatives
Gradients
Chain rule
Optimization

The goal isn't to memorize equations. You should understand how these concepts relate to machine learning.

Step 5: Learn NumPy

NumPy is fundamental to numerical computing in Python.

For example:

import numpy as np

numbers = np.array([10, 20, 30, 40])

print(numbers)
print(numbers.mean())
print(numbers * 2)

NumPy introduces you to arrays and vectorized computation.

This becomes useful when working with machine learning datasets, mathematical operations, and model computations.

Step 6: Learn Pandas and Data Processing

AI systems depend heavily on data.

Learn how to:

  • Load datasets
  • Clean missing values
  • Remove duplicates
  • Filter records
  • Transform columns
  • Combine datasets
  • Analyze data
  • Export results

Example:

import pandas as pd

data = {
    "name": ["A", "B", "C"],
    "score": [80, 90, 85]
}

df = pd.DataFrame(data)

print(df)
print(df["score"].mean())

A model is only as useful as the data and problem definition behind it, so data preparation is a major AI engineering skill.

Step 7: Learn Data Visualization

Learn how to inspect data visually.

Useful Python tools include:

Matplotlib
Seaborn
Plotly

Start with:

  • Bar charts
  • Line charts
  • Histograms
  • Scatter plots
  • Correlation visualizations

Visualization helps you understand patterns before training a model.

Step 8: Learn Machine Learning

Now move into traditional machine learning.

Start with Scikit-learn.

Important concepts include:

Supervised learning
Unsupervised learning
Classification
Regression
Clustering
Feature engineering
Training data
Testing data
Validation
Overfitting
Underfitting

Learn common algorithms such as:

Linear Regression
Logistic Regression
Decision Trees
Random Forests
K-Nearest Neighbors
Support Vector Machines
K-Means
Gradient Boosting

A simple example:

from sklearn.linear_model import LinearRegression

X = [[1], [2], [3], [4]]
y = [2, 4, 6, 8]

model = LinearRegression()

model.fit(X, y)

prediction = model.predict([[5]])

print(prediction)

The objective isn't to memorize every algorithm. Learn when an algorithm is appropriate and how to evaluate its results.

Step 9: Learn Model Evaluation

Training a model is only one part of machine learning.

You need to determine whether it actually works.

Learn metrics such as:

Accuracy
Precision
Recall
F1-score
Mean Absolute Error
Mean Squared Error
ROC-AUC

Also understand:

Confusion matrix
Cross-validation
Train/test split
Data leakage
Class imbalance

This is particularly important because a model can appear accurate while performing poorly on real-world data.

Step 10: Learn Deep Learning

Once you're comfortable with machine learning, move into deep learning.

Learn the basic concepts:

Neurons
Layers
Weights
Biases
Activation functions
Loss functions
Backpropagation
Gradient descent
Optimizers
Epochs
Batch size

Then choose a major framework such as PyTorch.

A simple neural network might look like:

import torch
import torch.nn as nn

model = nn.Sequential(
    nn.Linear(4, 16),
    nn.ReLU(),
    nn.Linear(16, 2)
)

print(model)

You don't need to build huge neural networks from scratch. Focus on understanding how training works and how to use modern frameworks effectively.

Step 11: Learn Computer Vision and NLP

After understanding deep learning, you can explore specialized AI fields.

Computer Vision

Learn concepts such as:

Image classification
Object detection
Image segmentation
OCR
Image embeddings
Vision transformers

Useful projects include:

  • AI document scanner
  • Object detector
  • Image classifier
  • OCR application

Natural Language Processing

Learn:

Text classification
Tokenization
Embeddings
Semantic similarity
Named entity recognition
Text generation
Transformers

These concepts prepare you for modern generative AI.

Step 12: Learn Generative AI

Modern AI engineering increasingly involves generative models.

Learn about:

Large Language Models
Embeddings
Prompt engineering
Context windows
Tokens
Inference
Fine-tuning
Structured outputs
Multimodal models

Then learn how to integrate models into Python applications.

For example, a simplified architecture could be:

User Question
      ↓
Python Application
      ↓
LLM
      ↓
Generated Response
      ↓
User

But production applications often require additional components.

Step 13: Learn RAG

Retrieval-Augmented Generation (RAG) allows an AI application to retrieve relevant information before generating an answer.

A typical architecture is:

Documents
   ↓
Chunking
   ↓
Embeddings
   ↓
Vector Database
   ↓
User Question
   ↓
Similarity Search
   ↓
Relevant Context
   ↓
LLM
   ↓
Answer

RAG is particularly useful for applications involving private or specialized documents.

For example, you could build a Python application that answers questions about a collection of PDF documents.

Step 14: Learn AI Agents

The next stage is building systems that can perform multiple actions rather than simply generating text.

An AI agent might:

Receive task
    ↓
Reason about task
    ↓
Choose a tool
    ↓
Execute tool
    ↓
Observe result
    ↓
Continue or finish

Tools might include:

  • Web search
  • Databases
  • APIs
  • File systems
  • Calculators
  • Code execution

For example, a research agent could receive a question, search several sources, analyze the information, and produce a structured report.

Python is particularly useful for implementing these workflows.

Step 15: Learn APIs and Backend Development

An AI model becomes much more useful when other applications can communicate with it.

Learn:

HTTP
REST APIs
JSON
Authentication
API keys
Request handling
Error handling

Then learn a Python web framework such as FastAPI.

Example:

from fastapi import FastAPI

app = FastAPI()

@app.get("/")
def home():
    return {"message": "AI service is running"}

You can eventually expose your AI model through an API that mobile applications, websites, or other services can use.

Step 16: Learn Databases

AI applications frequently need databases.

Start with:

SQLite
PostgreSQL

Then explore specialized systems when needed.

For generative AI applications, learn the purpose of vector databases and vector search.

Important concepts include:

Embeddings
Vectors
Similarity search
Metadata
Indexing
Retrieval

Step 17: Learn Docker and Cloud Deployment

A model running on your laptop is not necessarily a production application.

Learn:

Docker
Containers
Environment variables
Linux basics
Cloud services
CI/CD
Monitoring
Logging

You should eventually be able to move from:

Python program on laptop

to:

Docker container
      ↓
Cloud server
      ↓
API
      ↓
Users

Step 18: Learn AI Security

As AI applications become more powerful, security becomes increasingly important.

Understand concepts such as:

Prompt injection
Data leakage
Authentication
Authorization
Input validation
Rate limiting
Secrets management
Model abuse
Unsafe tool execution

AI systems can interact with sensitive information and external tools, so security should be considered during design rather than added at the very end.

Step 19: Build Real Projects

Projects are one of the best ways to turn theoretical knowledge into practical skills.

Instead of building 20 tiny programs, gradually create more sophisticated applications.

Beginner Projects

Python chatbot
Spam classifier
Movie recommendation system
Simple image classifier
Sentiment analyzer

Intermediate Projects

PDF question-answering system
AI document scanner
Image search application
AI summarization tool
Voice assistant
Recommendation engine

Advanced Projects

RAG application
AI research assistant
Multi-agent system
AI coding assistant
Document intelligence platform
AI customer-support system
Real-time AI application

Each project should teach you something new.

A Practical AI Engineer Roadmap

A simple progression looks like this:

Python
   ↓
Git + Software Engineering
   ↓
NumPy + Pandas
   ↓
Mathematics
   ↓
Machine Learning
   ↓
Scikit-learn
   ↓
Deep Learning
   ↓
PyTorch
   ↓
NLP / Computer Vision
   ↓
Generative AI
   ↓
LLMs + Embeddings
   ↓
RAG
   ↓
AI Agents
   ↓
APIs + FastAPI
   ↓
Databases
   ↓
Docker + Cloud
   ↓
AI Security
   ↓
Production AI Projects

You don't have to follow this sequence perfectly. Some topics can be learned in parallel.

What Should You Build for Your Portfolio?

A strong portfolio should demonstrate practical ability.

For example, create three major projects:

Project 1: Machine Learning Application

Build a prediction system using Scikit-learn.

Show:

Data preparation
Training
Evaluation
Prediction API

Project 2: RAG Application

Build a document assistant.

Show:

PDF files
   ↓
Text extraction
   ↓
Chunking
   ↓
Embeddings
   ↓
Vector search
   ↓
LLM
   ↓
Answer

Project 3: AI Agent

Build an agent capable of using multiple tools.

Show:

User
 ↓
Agent
 ↓
Tool selection
 ↓
API / Search / Database
 ↓
Result
 ↓
Final response

These projects demonstrate much more than simply knowing how to write prompts.

How Long Does It Take to Become an AI Engineer?

There is no fixed timeline because people begin with different levels of programming and mathematics knowledge.

A possible learning progression is:

Months 1-2
Python + Git + Programming

Months 3-4
NumPy + Pandas + Mathematics

Months 5-7
Machine Learning

Months 8-10
Deep Learning + PyTorch

Months 11-12
NLP + Computer Vision + Generative AI

Beyond 12 months
RAG + Agents + APIs + Cloud + Production

These are only rough stages. Consistent practice and project work matter more than completing a schedule quickly.

Don't Depend Entirely on AI Tools

AI coding assistants can accelerate development, but an AI engineer should understand the code being generated.

Use AI tools to:

  • Explain unfamiliar concepts
  • Generate prototypes
  • Find bugs
  • Suggest improvements
  • Create tests
  • Explore alternative approaches

But always review the output.

You should be able to answer:

What does this code do?
Why is this library being used?
What happens if the input is invalid?
How is the model evaluated?
Where is the data stored?
What are the security risks?

That understanding separates an AI engineer from someone who simply assembles AI-generated code.

Final Thoughts

Becoming an AI engineer with Python is a long-term learning journey, but it doesn't require learning everything at once.

Start with strong Python fundamentals. Then move through data processing, mathematics, machine learning, deep learning, generative AI, RAG, agents, APIs, databases, deployment, and security.

The most effective approach is:

Learn
  ↓
Build
  ↓
Break
  ↓
Debug
  ↓
Improve
  ↓
Build something harder

Don't wait until you know every topic before building projects. Start small and increase the complexity gradually.

Python gives you an excellent foundation, but the real goal is not simply to become good at Python. The goal is to become capable of designing, building, deploying, and maintaining useful AI-powered software.

That is the core of modern AI engineering.

Sunday, September 13, 2026

Tencent App Security Flaw Opens Door to GrayRabbit Malware Attacks

 

Tencent App Security Flaw Opens Door to GrayRabbit Malware Attacks

Cybersecurity researchers have uncovered a concerning attack campaign in which hackers exploited a vulnerability in a Tencent application to deliver GrayRabbit malware to targeted systems. The incident highlights how weaknesses in trusted software can become an entry point for attackers and why users should treat application updates and endpoint security as essential parts of digital safety.

A New Malware Delivery Route

Modern cyberattacks rarely depend on a single technique. Attackers often combine software vulnerabilities, social engineering, malicious files and persistence mechanisms to move from an initial compromise toward a larger infection.

In the campaign involving GrayRabbit, attackers reportedly took advantage of a flaw associated with Tencent software. Rather than relying solely on users downloading an obviously malicious program, the attackers used a legitimate application as part of the infection chain.

This approach can make an attack more difficult to recognize. Security software and users may naturally place greater trust in applications associated with well-known technology companies.

What Is GrayRabbit?

GrayRabbit is a malware threat associated with attacks designed to gain unauthorized access to compromised computers. Like other modern malware families, its capabilities can vary depending on the version deployed and the infrastructure controlled by the attackers.

Malware of this type can potentially be used to establish persistence, collect information, download additional malicious components or provide attackers with further control over an infected machine.

The most important concern is therefore not necessarily the initial malware file itself. Once attackers obtain a foothold, they may attempt to expand their access and introduce additional tools.

How the Attack Works

The reported campaign demonstrates a familiar pattern in modern cybercrime.

1. Exploiting vulnerable software

The attack begins with a weakness in the targeted Tencent application. A vulnerability can provide attackers with an opportunity to execute unauthorized actions or manipulate the software's normal behavior.

Software vulnerabilities become particularly dangerous when affected applications are widely installed.

2. Delivering the malicious payload

After gaining an initial foothold, attackers can attempt to introduce GrayRabbit or another malicious component onto the victim's system.

The malware may be disguised within a broader infection process, making it less obvious than a conventional malicious executable.

3. Establishing persistence

Attackers commonly attempt to ensure that malware survives a system restart. Persistence allows criminals to maintain access without having to repeat the original intrusion.

4. Communicating with attacker infrastructure

Once installed, malware may communicate with remote infrastructure controlled by the attackers. Depending on its configuration, this communication can allow criminals to issue commands or exchange information.

5. Expanding the compromise

A successful initial infection can become the starting point for additional malicious activity. Attackers may attempt to steal credentials, gather system information or deploy other malware.

Why a Trusted Application Can Become a Security Risk

One of the most important lessons from this incident is that trusted software is not automatically risk-free.

Popular applications are attractive targets because they can be installed on millions of computers. A vulnerability in widely deployed software can potentially give attackers access to a much larger pool of victims.

This is one reason security professionals recommend maintaining an updated software environment rather than assuming that well-known applications are inherently safe.

The Importance of Software Updates

Security patches are one of the simplest ways to reduce exposure to known vulnerabilities.

When developers discover a security weakness, they may release an updated version that addresses the underlying problem. Users who continue running older versions can remain vulnerable even after a fix becomes available.

Individuals and organizations should therefore:

  • Keep operating systems updated.
  • Install security updates for applications promptly.
  • Remove outdated software that is no longer required.
  • Download applications from legitimate sources.
  • Avoid modified or unofficial software packages.
  • Use reputable endpoint-security tools.
  • Monitor unusual application behavior.

Organizations Face Greater Risks

The consequences can be considerably more serious in corporate environments.

A compromised employee workstation may contain credentials, documents, browser sessions and access to internal services. If attackers successfully move from one machine to another, a small software vulnerability can potentially develop into a larger security incident.

Businesses should combine patch management with endpoint detection, network monitoring, access controls and employee security awareness.

The principle of least privilege is particularly useful. Applications and users should receive only the permissions they genuinely need. If malware manages to compromise one account, limiting its privileges can reduce the damage.

Signs of a Possible Infection

No single symptom proves that GrayRabbit or another specific malware family is present. However, unusual system behavior should receive attention.

Potential warning signs include:

  • Unexpected applications appearing on a computer.
  • Unknown processes consuming significant resources.
  • Unexplained network connections.
  • Browser settings changing without permission.
  • Security software being disabled unexpectedly.
  • New startup entries appearing.
  • Unusual account activity.
  • Unexpected files or scripts being created.

Organizations should investigate suspicious behavior through their security-monitoring systems rather than relying only on visual symptoms.

What Users Should Do

If a computer may have been compromised, users should avoid experimenting with suspicious files or attempting to manually remove unknown system components without understanding their purpose.

A safer response is to:

  1. Disconnect the affected computer from unnecessary networks.
  2. Run a reputable security scan.
  3. Update the operating system and affected applications.
  4. Change important passwords from a known-clean device.
  5. Enable multi-factor authentication where possible.
  6. Review account activity for suspicious logins.
  7. Contact an organization's IT or security team if the computer is business-owned.

Organizations should preserve relevant logs and forensic information before wiping compromised systems when an investigation may be necessary.

A Broader Warning for the Software Industry

The GrayRabbit incident illustrates a broader reality of cybersecurity: attackers increasingly look for weaknesses in the software users already trust.

The security of an application is not determined only by its developer. Users, administrators, operating-system vendors and security teams all play a role in reducing the attack surface.

Software companies must continue investing in vulnerability research, secure development practices and rapid patch distribution. At the same time, users need to install those fixes instead of leaving vulnerable versions on their devices.

Conclusion

The reported exploitation of a Tencent application vulnerability to distribute GrayRabbit malware is another reminder that cybercriminals can turn weaknesses in legitimate software into powerful attack opportunities.

For users, the most practical defenses remain straightforward: keep software patched, avoid unofficial downloads, use strong authentication and pay attention to unusual system activity.

For organizations, the incident reinforces the importance of vulnerability management, endpoint monitoring and limiting user privileges.

As attackers become more sophisticated, cybersecurity is increasingly about reducing opportunities for compromise before a malicious program gets the chance to establish itself.

How I Use AI Agents as a Data Scientist in 2026

  How I Use AI Agents as a Data Scientist in 2026 Artificial intelligence is changing the way data scientists work. In 2026, AI agents are ...