Episode 108: Run Python in a Browser With Pyodide & The Power of f-Strings
The Real Python Podcast
May 06, 2022 56m
Have you heard about the projects working toward getting Python to run in the browser? Maybe you would like to try it out for yourself, by building an interactive Python REPL with Pyodide and WebAssembly (WASM). This week on the show, Christopher Trudeau is here, and he’s brought another batch of PyCoder’s Weekly articles and projects.
Episode Sponsor:
We talk about a step-by-step project that shows you how to build a Python code editor in the browser using WebAssembly through Pyodide and CodeMirror. You’re going to be hearing a lot about Pyodide in the coming months, and here’s a chance for you to play around while building a small project.
Christopher shares an article about the power of Python f-strings. It covers some lesser-known features like variable debugging, nesting, and detailed formatting.
We also have a couple of topics up for discussion this week. They’re both related to finding work as a Python developer.
We cover several other articles and projects from the Python community, including the 2038 date problem, a primer about Python virtual environments, how to build a site connectivity checker in Python, a free book on digital signal processing in Python, and a project to build a voice-activated, password-protected wooden box.
Spotlight: Using Python’s datetime Module
Have you ever wondered about working with dates and times in Python? In this video course, you’ll learn all about the built-in Python datetime library. You’ll also learn about how to manage time zones and daylight saving time, and how to do accurate arithmetic on dates and times.
Topics:
- 00:00:00 – Introduction
- 00:02:38 – 2038 Date Problem
- 00:07:46 – Python Virtual Environments: A Primer
- 00:16:06 – Python f-Strings Are More Powerful Than You Might Think
- 00:20:19 – Sponsor: CData Software
- 00:21:01 – Build an Editor in Python and WebAssembly
- 00:28:19 – Build a Site Connectivity Checker in Python
- 00:30:21 – What Jobs Can I Have Knowing Python?
- 00:39:53 – Video Course Spotlight
- 00:41:12 – Projects for a Self-Taught Dev to Help Get a Job?
- 00:50:46 – ThinkDSP: Free Book on Digital Signal Processing in Python
- 00:53:14 – Durin’s Box: Voice-Activated, Password-Protected Wooden Box
- 00:55:05 – Thanks and goodbye
Topic Links:
- 2038 Date Problem (Funny, but True) – Coders old enough to remember Y2K are already dreading 2038. Join the conversation.
- Python Virtual Environments: A Primer – In this tutorial, you’ll learn how to use a Python virtual environment to manage your Python projects. You’ll also dive deep into the structure of virtual environments built using the
venv
module, as well as the reasoning behind using virtual environments. - Python f-Strings Are More Powerful Than You Might Think – Learn about the lesser-known features of Python’s f-strings, including date formatting, variable debugging, nested f-strings, and conditional formatting.
- Build an Editor in Python and WebAssembly – Step-by-step instructions on how to build a code editor in the browser using Python and WebAssembly (WASM), via Pyodide and CodeMirror.
- Build a Site Connectivity Checker in Python – In this step-by-step project, you’ll build a Python site connectivity checker for the command line. While building this app, you’ll integrate knowledge related to making HTTP requests with standard-library tools, creating command-line interfaces, and managing concurrency with asyncio and aiohttp.
Discussions:
Projects:
- ThinkDSP: Free Book on Digital Signal Processing in Python
- Durin’s Box: Voice Activated, Password Protected, Wooden Box
Additional Links:
- Tushar Sadhwani on Twitter: Add this to bash profile - export PIP_REQUIRE_VIRTUALENV=true
- Python 3’s f-Strings: An Improved String Formatting Syntax – Real Python
- A Guide to the Newer Python String Format Techniques – Real Python
- Cool New Features in Python 3.8 – Real Python
- “Why I Hate Frameworks”, Benji Smith (The Joel on Software Discussion Group)
- What are the top 10 job skills for the future? | World Economic Forum
- PyCoder’s Weekly | A Weekly Python E-Mail Newsletter