Skip to content

Latest commit

 

History

History
149 lines (109 loc) · 6.63 KB

File metadata and controls

149 lines (109 loc) · 6.63 KB

Module 000: Introduction to Python: History, Philosophy & Applications

Phase: 0. Orientation | Estimated time: 1 hour | Milestone Project: No

Prerequisites

  • None — this is the starting point for all learners.

Learning Objectives

By the end of this module, you will be able to:

  • Explain who created Python and when
  • Recite the guiding principles from the Zen of Python
  • Describe at least three major domains where Python is used
  • Understand at a high level how Python code becomes a running program (source → bytecode → interpreter)
  • Define what a PEP is and why the PEP process matters
  • Identify key characteristics of the Python community

Why This Matters

Every programming language has a culture and a philosophy. Python's emphasis on readability, simplicity, and community collaboration is the reason it is one of the most beginner-friendly and widely adopted languages in the world. Understanding where Python came from and what it values will help you write better code from day one.

Concept Explanation

A Brief History

Python was created in the late 1980s by Guido van Rossum, a Dutch programmer, and first released in 1991. Guido was working on the Amoeba distributed operating system and wanted a language that was both more powerful than a shell script and more readable than C. He named it after the British comedy series Monty Python's Flying Circus — not the snake.

Python has gone through several major versions:

1991 ── Python 0.9.0 (first public release)
1994 ── Python 1.0
2000 ── Python 2.0 (list comprehensions, garbage collection)
2008 ── Python 3.0 (major breaking change, "Python 3000")
2023 ── Python 3.12 (current stable release)

Python 2 was officially sunset on January 1, 2020. All modern Python development uses Python 3.

The Zen of Python

Open a Python interpreter and type import this. You will see 19 guiding principles written by Tim Peters. The most famous lines are:

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Readability counts.

These aphorisms are not just decoration — they shape how the language is designed and how the community writes code.

Philosophy: Readability and Simplicity

Python's syntax deliberately uses English keywords (and, or, not, if, else, for, while) rather than punctuation (&&, ||, !). Indentation is mandatory — this forces code to be visually structured. The language prioritizes one obvious way to do it over many clever ways.

Breadth of Applications

Python is a general-purpose language used in nearly every domain:

Domain Examples
Web Development Django, Flask, FastAPI
Data Science & Analytics pandas, NumPy, Jupyter
Machine Learning / AI TensorFlow, PyTorch, scikit-learn
Automation & Scripting Selenium, Ansible, custom scripts
Scientific Computing SciPy, Matplotlib
Game Development Pygame, Ren'Py
Desktop Applications Tkinter, PyQt
Embedded & IoT MicroPython, Raspberry Pi

How CPython Works (High Level)

When you run python myfile.py, here is what happens:

myfile.py (source code)
    │
    ▼
Parser ──→ Abstract Syntax Tree (AST)
    │
    ▼
Compiler ──→ Bytecode (.pyc file)
    │
    ▼
CPython Virtual Machine ──→ executes bytecode
  1. Parser reads your .py file and checks for syntax errors.
  2. Compiler translates the source into platform-independent bytecode (stored in __pycache__/).
  3. CPython Virtual Machine (the interpreter loop) reads bytecode and runs it on your CPU.

This "compile then interpret" hybrid gives Python both portability and reasonable performance.

The PEP Process

A PEP (Python Enhancement Proposal) is a design document describing a new feature, process, or standard for Python. PEPs are discussed, refined, and eventually accepted or rejected by the community. Major PEPs:

  • PEP 8 — Style Guide for Python Code
  • PEP 20 — The Zen of Python
  • PEP 572 — Assignment Expressions (the := walrus operator)
  • PEP 634 — Structural Pattern Matching

Anyone can submit a PEP — this openness is central to Python's governance.

The Python Community

Python has one of the most welcoming and well-organized programming communities in the world. Key pillars include:

  • Python Software Foundation (PSF) — non-profit that manages the language
  • PyCon — annual conference with hundreds of talks and tutorials
  • PyPi — Python Package Index, hosting over 500,000 packages
  • Discord, Reddit, Stack Overflow — active forums for help and discussion

Common Pitfalls

  1. Confusing Python 2 with Python 3: Some old tutorials still reference Python 2. Always check you are using Python 3.12+.
  2. Thinking bytecode is machine code: .pyc files are not native executable code; they still need the CPython interpreter.
  3. Assuming Python is "just scripting": Python is a full-fledged language used for large-scale production systems.
  4. Skipping PEP 8: Read PEP 8 early — it will save you from formatting debates later.

Hands-On Walkthrough

Since this is a conceptual module, the "hands-on" part is opening a Python interpreter and seeing the Zen for yourself:

  1. Open your terminal.
  2. Type python3 (or python on some systems) and press Enter.
  3. At the >>> prompt, type import this and press Enter.
  4. Read the 19 principles that appear. Pick your favorite line.
  5. Type exit() to leave the interpreter.

That's it — you've just run your first Python code!

Key Takeaways

  • Python was created by Guido van Rossum and first released in 1991.
  • The Zen of Python (PEP 20) guides the language's design philosophy.
  • Python prioritizes readability, simplicity, and explicitness.
  • Python is used in web dev, data science, ML, automation, and many other fields.
  • CPython compiles source code to bytecode, then interprets it on a virtual machine.
  • PEPs are the formal process for changing Python.
  • The Python Software Foundation and PyCon support a global community.
  • Always use Python 3 (never Python 2).

Further Reading

Next Module

Ready to get your hands dirty? Module 001: Setting Up Your Environment will walk you through installing Python and VS Code.