Skip to main content

Python

Introduction

General

macOS setup

  • Rye - Pyenv and Pip alternative from the creators of Ruff
    • Try this as an alternative to the steps below?
  • Install pyenv
    • brew install pyenv + brew install pyenv-virtualenv
      • confirm what I added in the end
  • Install Python using pyenv
    • do not brew install python or brew install python3
      • confirm if it’s installed
  • Set up VS Code
    • Add Python extension to VS Code
    • hopefully this doesn’t happen to you, but it did to me: if trouble with the Python extension (Python not added to the file language options list, python commands not working in integrated terminal):
      • completely uninstall VS code (via AppCleaner + Homebrew uninstall + rm -rf ~/.vscode)
      • start a new VS install (via Homebrew) from scratch
      • carefully add one extension and setting at a time + settings sync as you go after each change

Pyenv

Functions

Positional vs Keyword Arguments

Closures

Decorators

  • A beautiful Python monstrosity • An interesting refactoring journey in which abusing decorators resulted in much more readable code • Trey Hunner 📖

Classes

Loops

Performance

Types

Other Syntax

Testing

NumPy

Flask

Web Scraping

CSV Parsing

SQLAlchemy

Logging

Error Handling

Inbox