From PHP to Python

v2

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

Pricing
$79
+ tax
Full access to the 55 chapters
One-time payment, all future updates included
30-day guarantee – money-back promise
Choose between 60 syntax highlighting themes
Secure payment via Polar
Python Snake

What was once a book has become an online course, with more updated content.

Python 3.14+
PHP 8.5+
55 Chapters

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.

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!

— Matthias Noback

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.

— Ben Roberts

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 :)

— Gabriel Pillet / Tentacode

It is brilliant. I think you've done a stellar job. No criticisms.

— Christian Coyle

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.

Web Development

Build web applications with frameworks like Django, Flask or FastAPI. The core skills you learn here directly apply to web development.

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.

Copied
Highlighting...
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.

Copied
Highlighting...
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.

Copied
Highlighting...
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.

Copied
Highlighting...
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 chapters
01 Free

Introduction

02 Free

Before we start

03 Free

Language syntax

04 Free

Data types

05 Free

Positional and keyword arguments

06 Free

Unpacking

07 Free

Comprehensions

Premium Chapters

48 chapters
08 Premium

Local and global variables

09 Premium

Classes and objects

10 Premium

Objects, objects… objects everywhere!

11 Premium

== and is explained

12 Premium

Imports, modules and packages

13 Premium

Exceptions

14 Premium

Working with strings

15 Premium

Datetimes

16 Premium

Match case

17 Premium

Working with regexes

18 Premium

Magic methods

19 Premium

Lamdbas

20 Premium

Documenting and debugging your code

21 Premium

Decorators

22 Premium

Context managers

23 Premium

Generators

24 Premium

Managing dependencies with pip

25 Premium

Let's bring some light with uv

26 Premium

Managing multiple Python versions with uv

27 Premium

Monkey patching

28 Premium

Testing with unittest

29 Premium

Testing with pytest

30 Premium

Type hints

31 Premium

Enums

32 Premium

Interacting with the filesystem

33 Premium

Working with environment variables

34 Premium

Logging

35 Premium

Template-strings

36 Premium

Interacting with the CLI

37 Premium

Walrus operator

38 Premium

DTOs in Python

39 Premium

Mixins

40 Premium

Interfaces

41 Premium

Serializing

42 Premium

Standard lib and interesting modules

43 Premium

Tooling and linting

44 Premium

Publishing a package on PyPI

45 Premium

The long-running shift

46 Premium

Interacting with databases

47 Premium

Concurrency: Theory and CPU

48 Premium

Concurrency: Threading

49 Premium

Concurrency: Multiprocessing

50 Premium

Concurrency: AsyncIO

51 Premium

PEP ?

52 Premium

Web frameworks

53 Premium

WSGI and servers

54 Premium

Python culture

55 Premium

Lexicon

The Author

YR

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.

Frequently Asked Questions

I have already bought the book on Gumroad. Do I need to pay again?
No, for you the course is free, of course. Just use the same purchase email you used on Gumroad to access the course.
What's wrong with PHP?
I still work a lot with PHP and enjoy it. I am not saying Python is a better language. They both have their pros and cons. The goal of the course is to make you a proficient Python developer and to widen your professional opportunities: not to criticize PHP.
What if I don't like the course?
If you don't like the course, you can ask for a refund within 30 days by sending an email to hello@fromphptopython.com.
Which payment provider do you use?
This course uses Polar. You can safely pay with your credit card, Paypal, Apple Pay or Google Pay.
Pricing too steep for your region or situation?
Drop us a line at hello@fromphptopython.com and we'll figure out a fair price together.
Which are the last versions of PHP and Python this course covers?
This course covers up to PHP 8.5 and Python 3.14.