Python for PHP devs.

Table of Contents

Chapter 1 - The Encounter

Your PHP foundation is a powerful starting point!

  1. Python vs PHP
  2. Install and Manage Python
  3. Python IDEs
  4. Setting Up a Python Project

Chapter 2 - Mind the Gap

Python’s Surprises: Concepts That Trip Up PHP Devs

  1. The Immutability
  2. The Tuple
  3. The REPL

Chapter 3 - The Basics

  1. Syntax Overview
  2. Data Types
    1. Everything is Object
    2. Numeric Objects
    3. String and Formatting
    4. Array (Tuple, List, Set)
    5. Dictionary
  3. Control Flow
  4. Error Handling
  5. Standard Library Features
    1. argparse, datetime, logging

Chapter 3 - Functions, Files, and Loops

  1. Functions
  2. Functional Tools (map, filter, itertools and list comprehensions)
  3. Parameters (*args, **kwargs)
  4. File I/O
  5. Iterators and Generators

Chapter 4 - Packages, Modules, and Dependencies

  1. Modules, Packages & Environment
    1. The import system
  2. Python Package Managers 2. Managing Dependencies
  3. Virtual Environment

Chapter 5 - Object-Oriented Programming (OOP)

  1. OOP in Python
  2. Magic Methods
  3. Design Patterns

Chapter 6 - Testing and Linting

  1. Testing Frameworks
  2. Linting and Code Quality
  3. Continuous Integration(CI)

Chapter 7 - Web Development and Frameworks

  1. Web Frameworks
  2. Template Engins
  3. Routing, Middleware, and RESTful APIs

Chapter 8 - Advanced Topics

  1. Asynchronous Programming
    1. async/await, asyncio, and event loop
  2. Concurrency and Parallelism
    1. GIL
    2. Threading and Multi-Processing
  3. Performance Optimization

Chapter 9 - Best Practices and Pitfalls

  1. Pythonic Idioms (Avoiding PHP-like anti-patterns)
  2. Common Pitfalls (Mutable defaults, scoping, and type hinting)
  3. Community and Resources (Python documentation, Stack Overflow, and forums)

Valuable Resources

  • Bill Martin’s “Python for PHP Developers: Deep Dive” series link