Exova Academy

Module 1 — Getting Started with Python · 25 min

Why Python, and how it works

Julie Martin is an office administrator at Ferrand & Fils, an office-supply distributor based in Lyon, France, with eighteen employees. Every Monday, she spends an hour filing the supplier invoices piling up in her Downloads folder. At the end of every month, she copies sales figures from three Excel files into a summary sheet, then writes about ten payment reminder emails by hand for unpaid invoices. All told, that's nearly six hours a month of mechanical, low-value work, where the slightest typo comes back to bite her later.

Julie doesn't want to become a developer. She wants these tasks to happen on their own, and to happen correctly. That is exactly where Python shines. In this course, you'll follow her journey: from her first print all the way to an assistant that files her documents, consolidates her spreadsheets, sends her reminders and produces an analysis report. This first lesson answers two questions: why Python, and what actually happens when you run a program?

What a program actually is

A program is a list of precise instructions that a computer executes in order. The computer doesn't guess anything: it doesn't understand "tidy up this folder a bit" or "do it the usual way." It understands "for each file in the folder, if its name ends with .pdf and contains the word invoice, move it into the Invoices/2026-10 folder."

That precision is the real skill to learn. The programming language is just a way of writing it down. As a preview, here is what that instruction looks like in Python. You don't need to understand it in detail today, but notice how it reads almost like plain English:

from pathlib import Path

downloads = Path.home() / "Downloads"
for file in downloads.iterdir():
    if file.suffix == ".pdf" and "invoice" in file.name.lower():
        print("To file:", file.name)

Four useful lines, and Julie gets the list of all her pending invoices. In Module 4, you'll write the complete version that creates the folders and moves the files.

Why Python rather than another language

There are hundreds of programming languages. Python has become the go-to choice for automation and data analysis for four practical reasons.

It's readable. Python uses indentation (shifting lines to the right) to structure code, along with simple English words: if, for, while, def. A beginner can reread last week's code without getting lost.

It's versatile. The same language lets you handle files, read and write Excel workbooks, send emails, query a website, analyze millions of rows of data or call an AI.

It has a huge ecosystem. The Python Package Index (PyPI) lists more than 500,000 packages, ready-to-use building blocks of code. Need to read an Excel file? openpyxl. Analyze data? pandas. Generate a PDF? fpdf2. You don't write everything yourself: you assemble.

It's free and everywhere. Python runs on Windows, macOS and Linux, and it's used by government agencies, banks, research labs and small businesses. Help resources are countless.

The following table compares Python with the alternatives Julie already knows:

Tool Strengths Limitations for Julie
Excel macros (VBA) Built into Excel Locked into Office, hard to maintain
No-code tools (Zapier, Make) Quick to connect Pay-per-use, limited to the connectors on offer
JavaScript King of the browser Less suited to local files and data
Python Files, Excel, emails, web, data Takes a few weeks to learn

Python doesn't replace Excel: it drives it. Julie will keep her workbooks, but she won't be the one doing the copying and pasting anymore.

How Python runs your code

When you write Python, you produce a plain text file ending in .py, called the source code. The computer, on the other hand, only understands very basic binary instructions. So you need a go-between: the Python interpreter, a program you'll install in the next lesson.

%% titre: From .py file to result
%% narration: This diagram follows a script's journey. Julie writes a text file, the interpreter translates it into bytecode, then the Python virtual machine runs it and produces the result on screen or in files.
flowchart LR
  A["Script report.py"] --> B["Python interpreter"]
  B --> C["Bytecode"]
  C --> D["Python virtual machine"]
  D --> E["Result: screen, files"]
From .py file to result

Here are the steps:

  1. You run the command python report.py.
  2. The interpreter reads the file and checks the syntax. Forgot a parenthesis? It stops immediately with a SyntaxError and tells you the line.
  3. It translates the code into bytecode, a more compact intermediate form.
  4. The Python virtual machine executes that bytecode one instruction at a time, from top to bottom.
  5. If an error occurs during execution (a missing file, a division by zero), the program stops and displays an error message called a traceback.

Above all, remember point 4: Python runs from top to bottom, one line after another. If line 12 uses a value defined on line 30, it fails. This order of execution explains most beginner errors.

Python is called an interpreted language, as opposed to compiled languages like C or Go, which turn the whole program into an executable before running it. Interpretation is a bit slower, but for Julie's tasks (filing 200 files, reading a 5,000-row workbook) the difference is measured in milliseconds.

Two ways to talk to Python

There are two ways to use the interpreter, and you'll use both all the time.

Interactive mode (the console, or REPL). You type python in a terminal, a >>> prompt appears, and each line you enter runs immediately. It's a supercharged calculator, perfect for testing an idea in a few seconds:

>>> 18 * 35
630
>>> "Ferrand & Fils".upper()
'FERRAND & FILS'

Script mode. You write a .py file in an editor, save it, then run it with python file_name.py. The code is kept, can be rerun as often as you like, and can be shared. Any serious automation is a script.

%% titre: Interactive console or script
%% narration: This diagram compares the two uses. The console is for testing an idea in a few seconds, the script is for keeping and rerunning a complete automation.
flowchart TD
  A{"What does Julie need?"} -- "test an idea" --> B["Interactive console"]
  A -- "automate a task" --> C[".py script"]
  B --> D["Immediate result, nothing is kept"]
  C --> E["Can be rerun every month"]
Interactive console or script

Best practice: explore in the console, then copy what works into a script.

What Python won't do for you

Let's be honest about the limits, to avoid disappointment.

  • Python doesn't invent the logic. If Julie can't explain which invoices are "unpaid" (past the due date? reminder already sent?), no program will know either. The first step of any automation is always to write the rule down in plain language.
  • An automated mistake repeats at scale. A script that sends a wrong email sends it to fifty clients. You'll learn to test on copies and to build in a "dry run" mode.
  • Not everything is worth automating. A five-minute task done twice a year doesn't deserve three hours of code. Rule of thumb: automate what is frequent, repetitive and error-prone.
  • Python 2 is dead. You'll come across old tutorials with print "hello" without parentheses. That's Python 2, abandoned since 2020. This course uses Python 3.12 or later.

Hands-on practice

Before installing anything, do the most important work: figure out what to automate.

  1. List five repetitive tasks from your job (or, failing that, Julie's tasks described in the introduction).
  2. For each one, note the frequency, the duration and the risk of error (low, medium, high).
  3. Pick the most worthwhile task and describe it as numbered steps, in plain language, as precisely as if you were dictating them to an intern who knows nothing about your company.

Expected deliverable: a five-row table and a 5- to 10-step procedure for the chosen task.

Show solution

Here is Julie's table:

Task Frequency Duration Risk of error
File downloaded invoices Weekly 1 h Medium (misplaced files)
Consolidate sales from 3 workbooks Monthly 2 h High (copy-paste)
Send email reminders for unpaid invoices Monthly 1 h 30 min Medium (a client forgotten)
Produce the monthly report for Paul Ferrand Monthly 1 h Medium
Update the supplier list Quarterly 30 min Low

The most worthwhile task to start with: filing invoices (frequent, simple, clear rules). Procedure:

  1. Open the Downloads folder.
  2. For each file, look at its extension.
  3. Skip files that aren't PDFs.
  4. If the name contains "invoice" (upper or lower case), it's an invoice.
  5. Read the file's modification date to find out the month.
  6. Create the matching Invoices/YYYY-MM folder if it doesn't exist.
  7. Move the file into that folder.
  8. If a file with the same name already exists, add a number to the name instead of overwriting it.
  9. At the end, display the number of files moved.

Notice steps 3 and 8: these are edge cases you don't naturally think of. Writing them down now prevents bugs later. This procedure will become a real script in Module 4.

Key takeaways

  • A program is a sequence of precise instructions executed in order, from top to bottom.
  • Python is readable, versatile and free, and its ecosystem of packages saves you from rewriting everything.
  • The interpreter translates your .py file into bytecode, which the Python virtual machine executes.
  • The console is for testing, the script is for lasting automation.
  • Before coding, describe the task in precise steps: that's half the work.

Enjoyed this lesson?

Unlock all 40 lessons, the quizzes and the certificate.

Buy — $197