A straight-to-the-point guide
From PHP to Python
The fastest way for PHP developers to learn Python.
You're almost a Python developer. You just don't know it yet.
Full course. Available now.
7 chapters free • No credit card required
Start from what you know
Take your existing PHP knowledge and map it directly to Python. You learned so many things over the years (variables, loops, functions, objects, etc.). Why not reuse that knowledge?
My promise to you: this course is the fastest way to learn Python you can find out there, if you already know PHP.
Side-by-side code
Where relevant, PHP and Python code is shown side-by-side so you can understand the differences at a glance.
Both languages are shown in different syntax-highlighted code blocks (you can even choose your favorite color theme for both!).
By a passionate PHP developer
I love writing PHP but I also fell in love with Python.
I wrote the course I wish I had when I started learning it. I wrote every single line of it (which took me several thousand hours). Not a single line of the course has been written by AI. The content is real.
$numbers = [0, 3, 3, 2, 1, 6];
// [0, 4, 36]
$squaresOfEvenNumbers = array_map(
fn($number) => $number * $number,
array_filter($numbers, fn($number) => $number % 2 === 0)
);
numbers = [0, 3, 3, 2, 1, 6]
# [0, 4, 36]
[number * number for number in numbers if number % 2 == 0]
What was once a book has become an online course, with more updated content.
Start from what you know
Take your existing PHP knowledge and map it directly to Python. You learned so many things over the years (variables, loops, functions, objects, etc.). Why not reuse that knowledge?
My promise to you: this course is the fastest way to learn Python you can find out there, if you already know PHP.
Side-by-side code
Where relevant, PHP and Python code is shown side-by-side so you can understand the differences at a glance.
Both languages are shown in different syntax-highlighted code blocks (you can even choose your favorite color theme for both!).
By a passionate PHP developer
I love writing PHP but I also fell in love with Python.
I wrote the course I wish I had when I started learning it. I wrote every single line of it (which took me several thousand hours). Not a single line of the course has been written by AI. The content is real.
$numbers = [0, 3, 3, 2, 1, 6];
// [0, 4, 36]
$squaresOfEvenNumbers = array_map(
fn($number) => $number * $number,
array_filter($numbers, fn($number) => $number % 2 === 0)
);
numbers = [0, 3, 3, 2, 1, 6]
# [0, 4, 36]
[number * number for number in numbers if number % 2 == 0]
Trusted by PHP experts
I had the honor of reading a draft of this book. It's been extremely helpful. Most Python books and courses start with the basics of programming; this book assumes you have experience with PHP so you can dive into the relevant differences really quickly. Recommended!
The book is amazing - it simply fit in with my needs perfectly. I've been doing PHP for 25 years, as well as Javascript, Typescript, Kotlin. I wanted to get a feel for Python and reading your book has made the entire process super comfortable. It is so well written, but the real gold is how you've made the right assumptions about what an experienced PHP dev will already know. The balance is very well calculated.
I have 15 years of experience in PHP dev and needed to learn Python for a hiring test, this book was really made for people like me and I'd recommend it for anyone that wants to try Python while already being an expert in PHP :)
It is brilliant. I think you've done a stellar job. No criticisms.
Am I the target audience?
This is for you if
- You have 3+ years of professional PHP experience and can confidently build complex web applications.
- You are curious about Python and want to either just discover it to see what it is about or even become a professional Python developer.
- You're frustrated with beginner-level Python content that explains basic programming concepts you already know and you want to learn QUICKLY.
This is not for you if
- You barely know PHP or want a course to learn programming: if Python is your first language, this course is not for you. You have plenty of amazing resources out there adapted to your path.
- You already know Python well: this is for people who barely know Python but know PHP well.
- You don't have an open mind: Python does things very differently than PHP in some areas. That's why I think it's a very interesting journey. If you're not open to a different philosophy or way of doing, it's okay. This course is just not for you.
Python is the new black
Python has become one of the most sought-after skills in the job market. Whether you're looking to boost your career, command higher salaries, or stay competitive in a rapidly evolving tech landscape, Python is the skill that opens doors.
All the data points below consistently highlight Python's immense popularity and growth in the developer community.
Stack Overflow Survey 2025
The Stack Overflow Survey shows the languages developers use most frequently. Python ranks 4th among professional developers, right after JavaScript, HTML/CSS, and SQL.
"Python adoption grew in 2025: After more than a decade of steady growth, Python's adoption has accelerated significantly. It saw a 7 percentage point increase from 2024 to 2025; this speaks to its ability to be the go-to language for AI, data science, and back-end development."
Stack Overflow Survey 2025 - Most Popular Technologies (Languages)
| Rank | Language | Usage |
|---|---|---|
| 1 | JavaScript | 66% |
| 2 | HTML/CSS | 61.9% |
| 3 | SQL | 58.6% |
| 4 | Python | 57.9% |
| 5 | Bash/Shell | 48.7% |
| 6 | TypeScript | 43.6% |
| 7 | Java | 29.4% |
| 8 | C# | 27.8% |
| 9 | C++ | 23.5% |
| 10 | PowerShell | 23.2% |
| 11 | C | 22% |
| 12 | PHP | 18.9% |
GitHub's 2025 Octoverse
GitHub's 2025 Octoverse survey reveals Python ranks #2 among all programming languages, with 2.6 million active contributors and a remarkable 48% year-over-year growth rate.
Python remains dominant in AI and data science, establishing itself as the essential language for exploratory AI work through widespread Jupyter notebook adoption.
JetBrains: The State of PHP 2025
According to JetBrains’ State of PHP 2025 survey, Python is the second most desired language for developers looking to switch next year, right behind Go.
More than 10% of PHP developers said they’re interested in learning Python.
Are you one of them?
Do you plan to adopt or migrate to other languages in the next 12 months? If so, which ones?
| Language / Option | Percentage |
|---|---|
| No, I'm not planning to adopt or migrate | 58% |
| Go | 15% |
| Python | 11% |
| Rust | 7% |
| TypeScript | 7% |
| Kotlin | 6% |
Python features
What makes Python truly powerful is its versatility across domains. Learn Python once, apply it everywhere.
Scripting & CLI
Automate system administration tasks, DevOps workflows, and batch processing. Python's simplicity makes it perfect for writing maintainable automation scripts.
Huge Ecosystem
Access PyPI's millions of packages for any use case.
Data Science & AI
After finishing this course, you could explore machine learning with NumPy, pandas, and scikit-learn. Python's language foundation transfers perfectly to data science.
Python has a different philosophy that brings interesting solutions to common problems. Explore some features that make Python unique.
Context Managers
Context managers in Python provide a clean and efficient way to manage resources like file handling, database connections, and network sockets. They ensure that resources are properly acquired and released, even in the presence of errors.
with open('example.txt', 'r') as file:
data = file.read()
# The file is automatically closed after the `with` block
Operator overloading
Python allows you to define custom behavior for standard operators (like +, -, *, etc.) in your classes. This feature, known as operator overloading, enables you to create intuitive and expressive APIs for your custom types.
class Money:
def __init__(self, amount):
self.amount = amount
def __add__(self, other):
return Money(self.amount + other.amount)
# Usage
m1 = Money(100)
m2 = Money(50)
# Money(150)
m3 = m1 + m2 # Uses the overloaded + operator
Comprehensions
Python's comprehensions are an elegant concise way to create lists, sets, and dictionaries.
numbers = range(1, 11)
# Create list of squares
squares = [x**2 for x in numbers]
# Filter and transform
even_squares = [x**2 for x in numbers if x % 2 == 0]
# Create a dict
squares_dict = {x: x**2 for x in numbers}
Decorators
Decorators allow you to modify the behavior of functions or classes. They are a powerful way to implement cross-cutting concerns like logging, access control, and caching.
import time
def timer(func):
def wrapper(*args, **kwargs):
start = time.time()
result = func(*args, **kwargs)
end = time.time()
print(f"Execution time: {end - start} seconds")
return result
return wrapper
@timer
def compute_factorial(n):
if n == 0:
return 1
return n * compute_factorial(n - 1)
Table of Contents
Free Chapters
7 chaptersIntroduction
Before we start
Language syntax
Data types
Positional and keyword arguments
Unpacking
Comprehensions
Premium Chapters
48 chaptersLocal and global variables
Classes and objects
Objects, objects… objects everywhere!
== and is explained
Imports, modules and packages
Exceptions
Working with strings
Datetimes
Match case
Working with regexes
Magic methods
Lamdbas
Documenting and debugging your code
Decorators
Context managers
Generators
Managing dependencies with pip
Let's bring some light with uv
Managing multiple Python versions with uv
Monkey patching
Testing with unittest
Testing with pytest
Type hints
Enums
Interacting with the filesystem
Working with environment variables
Logging
Template-strings
Interacting with the CLI
Walrus operator
DTOs in Python
Mixins
Interfaces
Serializing
Standard lib and interesting modules
Tooling and linting
Publishing a package on PyPI
The long-running shift
Interacting with databases
Concurrency: Theory and CPU
Concurrency: Threading
Concurrency: Multiprocessing
Concurrency: AsyncIO
PEP ?
Web frameworks
WSGI and servers
Python culture
Lexicon
The Author
Yann Rabiller
Backend developer
I’m a professional backend developer and author from France with over 10 years of experience building robust, scalable web applications. I've worked extensively with Symfony, Laravel, and Django, giving me deep insight into how different frameworks approach similar problems.