Watch the live stream:
Watch on YouTube
About the show
Sponsored by Datadog: pythonbytes.fm/datadog
Special guest: Dean Langsam
Brian #1: A Better Pygame Mainloop
- Glyph
- Doing some game programming is a great way to work on coding for early devs (and experienced devs).
- pygame is a popular package for writing games in Python
- But… the normal example of a main loop, which listens for events and dispatches actions based on events, has some problems:
- it’s got a while 1:
- that wastes power, too much busy waiting
- looks bad, due to “screen tearing” which is writing to a screen while your in the middle of drawing it
- This post discusses the problems, and walks through to an async main loop that creates a better gaming experience.
Michael #2: awesome sqlalchemy
- A few notable ones
- SQLAlchemy-Continuum: Versioning and auditing extension for SQLAlchemy.
- SQLAlchemy-Utc: SQLAlchemy type to store aware datetime.datetime values.
- SQLAlchemy-Utils: Various utility functions, new data types and helpers for SQLAlchemy
- filedepot: DEPOT is a framework for easily storing and serving files in web applications.
- SQLAlchemy-ImageAttach: SQLAlchemy-ImageAttach is a SQLAlchemy extension for attaching images to entity objects.
- SQLAlchemy-Searchable: Full-text searchable models for SQLAlchemy.
- sqlalchemy_schemadisplay: This module generates images from SQLAlchemy models.
- Can we also get a shoutout to SQLModel?
Dean #3: ThreadPoolExecutor in Python: The Complete Guide
- Long, but worth it (80-120 minutes). Could be consumed in parts. It’s mostly a collection of other blogposts on superfastpython
- Many examples
- LifeCycle
- Usage patterns
- Map and was
- as_completed vs sequentially
- callbacks
- IO-Bound vs CPU-bound
- Common Questions
- Comparison
- vs. ProcessPoolExecutor
- vs. threading.Thread
- vs. AsyncIO
Brian #4: Chaining comparison operators
- Rodrigo Girão Serrão
- I use chained expressions all the time, mostly with ranges: