Skip to content

source code

Source code, sometimes just called “source” or “code”, consists of human-readable computer instructions written by programmers. It’s the original form of a computer program, before it’s translated into a form that a machine can run. In Python, source code is compiled into bytecode, the internal representation that the Python virtual machine executes.

Here’s an example of some source code written in Python:

Language: Python Filename: example.py
def do_twice(func):
    def wrapper_do_twice(*args, **kwargs):
        func(*args, **kwargs)
        func(*args, **kwargs)
    return wrapper_do_twice

@do_twice
def greet(name):
    print(f"Hello, {name}!")

When programmers talk about “reading the source” or “checking the source code,” they mean examining these original, human-readable program files. The source code represents the authoritative version of how a program works and contains all the implementation details of its functionality.

How to Run Your Python Scripts

Tutorial

How to Run Your Python Scripts and Code

Learn how to run Python scripts from the command line, REPL, IDEs, and file managers on Windows, Linux, and macOS. Master all execution approaches.

basics best-practices devops python

For additional information on related topics, take a look at the following resources:

Have a question about this? Mentor AI can show you examples, compare related terms, and point you to tutorials.


By Dan Bader • Updated Sept. 23, 2026