PyDev of the Week: Jeffrey Glass

This week we welcome Jeffrey Glass (@JeffersGlass) as our PyDev of the Week! Jeffrey is the maintainer of PyScript. PyScript is a framework that allows users to create rich Python applications in the browser using HTML’s interface and the power of Pyodide, WASM, and modern web technologies.

You can catch up with Jeff by checking out his website. If you’d like to see what else Jeff is up to, you need to go view his GitHub profile.

Let’s spend some time getting to know Jeff better!

Can you tell us a little about yourself (hobbies, education, etc):

I grew up in Silicon Valley in California, but moved to Chicago for college many years ago; I received a BA in Theatre with a Mathematics Minor at Northwestern university. I spent the first ten years of my career in live theatre, managing lighting, video, and special effects. Presently, I’m an exhibit engineer for a science museum, building and repairing interactive exhibits.

Outside of software, I hold an Extra Class amateur radio license, and am fairly conversant in morse code – I enjoy getting out into our state parks and throwing an antenna wire in a tree. I enjoy 3D printing, and I have a collection of interesting Salts from around the world.

Why did you start using Python?

I’ve been coding as a hobby and part of my profession since middle school, when I set up a QBasic program on my geometry teacher’s computer to play spurious beeps and bloops in the middle of class. The rapidity and friendliness of that coding experience is something I didn’t find again till I came to Python.

Python is the language that most feels like it gets out of the way, and lets the developer get on with the hard part of writing software: the thinking. In my career and hobby time, I need programs which come together fast, that are readable and debuggable, and that I stand a chance of understanding when I come back to them in a year. Python is the best candidate for that so far.

What other programming languages do you know and which is your favorite?

I’ve worked a lot in embedded C over the years, building stage and interactive electronics, though I’ve increasingly moved to CircuitPython/MicroPython. Many of the programmable logic controllers that get used for automation control still use ladder logic, which is a fun brain-bender. I’ve picked up some Java and JavaScript along the way as well, and I spend much of my time these days in TypeScript.

My favorite of those is probably TypeScript – the expressive type system is a real speed multiplier.

What projects are you working on now?

In addition to working on PyScript and its community, I’m developing Emshell, an in-browser shell for programs that use the Emscripten file system.

Which Python libraries are your favorite (core or 3rd party)?

From the standard library, difflib is great; I use it to help generate change-reports in different kinds of data or code, often with the ast package. I spend a lot of time with asyncio as well, as a consequence of living in the largely-single-threaded world of the browser.

For 3rd party libraries, I love Rich and Textual, the terminal-formatting and TUI libraries. Pytest is killer too – I’m always discovering a new option or plugin that makes it even more versatile. Pytest + Playwright is our main setup for PyScript.

What are your top three favorite things you like about PyScript?

The interoperabibility (provided by the Pyodide runtime) is incredible – it allows devs to use basically any in-browser JavaScript library while writing only Python. The plugin system (which is rapidly evolving) lets users add features, or make modifications to how PyScript runs. And the community and team are great – everyone’s very excited about bashing things together and getting them into the wild.

What are some of the coolest things you’ve seen that were created with PyScript?

Here’s a really simple example. We had an English Teacher come through our Discord with an issue: when teachers in his district took a class for mandatory training hours, they needed to provide their supervisors with a physical certificate with the details, but trainers weren’t expecting to provide physical handouts in 2023. The teacher created a site with PyScript where users could enter their information, and it would generate a downloadable, official-looking PDF as required.

What’s neat is that, since PyScript is statically hostable, the whole page could sit on GitHub pages, or I think eventually just as an HTML file on their school server. It was easy for the teacher to write because it’s all Python, and it’s easy to deploy because it’s PyScript. That’s an awesome synergy.

On a more advanced note, I love seeing the folks in the community who are using PyScript for their frontend and Django/Flask for their backend, so the whole stack is Python. We hear “I know Python, I’m glad I don’t also have to learn JavaScript” a lot.

Is there anything else you’d like to say?

There’s no such thing as a dumb question, especially on an Open Source project. If you’re a user and you have a question, it’s perfectly alright to ask it in a GitHub discussion/forum/Discord channel etc. Even if it turns out there’s a simple answer, just hearing the question helps us devs know something could be improved – maybe the documentation is unclear or hidden or out of date, maybe we need more prominent examples, etc.

Thanks for doing the interview, Jeffrey!