VOOZH about

URL: https://thenewstack.io/pyscript-a-browser-based-python-framework/

⇱ Pyscript: A Browser-Based Python Framework for the 99% - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2022-07-08 07:55:22
Pyscript: A Browser-Based Python Framework for the 99%
Frontend Development / Software Development

Pyscript: A Browser-Based Python Framework for the 99%

Pyscript leverages Web Assembly to offer non-traditional programmers a browser-based framework for running Python.
Jul 8th, 2022 7:55am by Loraine Lawson
👁 Featued image for: Pyscript: A Browser-Based Python Framework for the 99%
Featured image via screenshot of Pyscript.net

Raphael Madu, who programs in machine language and Python, isn’t sure he sees the point of Pyscript, the new Python framework being developed by Anaconda.

It’s interesting, he told The New Stack, but the mechanical engineering intern didn’t see the point despite having tried it and written a short tutorial on it.

“It seems it has a lot of potential,” he said. “But for now, there’s nothing really from Pyscript right now that I’ve seen.”

He’s not the only programmer who doesn’t see the point — and that’s okay, said Anaconda co-founder and CEO Peter Wang. Pyscript is not trying to convert professional web developers. Instead, it’s designed for the 99% of web users who aren’t professional developers, Wang said.

“The biggest thing I would say to people who are like, ‘I don’t see why this is necessary,’ is simply [that] it’s not about you,” he said. “It’s for all of the schoolchildren that you don’t spend your afternoons trying to teach how to build their first application.”

Inspired by HyperCard

To teach a child how to program today is complicated. Beyond teaching them programming, you’d also need to teach them how to bundle, about web server architecture and cloud deployment. You’d “spend three days teaching them that before they can do a ‘Hello World’ app,” Wang said.

Besides a strong sense of justice, what inspired Wang was his own early experience growing up with HyperCard, a pre-web development kit for the Macintosh that included a scripting language.

“HyperCard was about my second or third programming language or environment, and I still remain very inspired by how simple it was for a child — I was a child at the time — to start putting together real applications,” Wang said.

During his long tenure with Python, he’s seen many people try Python on as their first language. He empathizes with these novices and citizen developers, and hopes Pyscript will provide them with a way to quickly use Python for their first “Hello World.”

How Pyscript Works

Python is easy to learn, but it’s challenging to write and distribute Python applications with a user interface, LWN.net pointed out recently. Even using a web frontend requires writing JavaScript, CSS and HTML, Wang told LWN.

It turns out, the key to deploying Python is WebAssembly, Wang explained. Last year, Anaconda began to explore the work being done with Python and WebAssembly — projects like Pyodide and JupyterLite, which have compiled parts of the Python scientific and numerical stack to target WebAssembly.

“We were intrigued by some of the underlying work that was starting to happen around Python and WebAssembly,” he told The New Stack. “Once the thing in my head clicked, that it’s not just about having a little Python terminal embedded in the browser, running WebAssembly, but actually, let’s open up the entire browser environment to all of Python and all the Python data stuff, then just a lot of things started cascading from that.”

WebAssembly is a W3C standard supported by browsers, including mobile browsers. As Wang explained to LWN.net, WebAssembly is a virtual CPU instruction set with a 32-bit address space; and it can do 64-bit arithmetic. The compiler, Emscripten, can be used to compile most C and C++ code to WebAssembly. Because CPython is a C program, much of the Python numerical stack is written in C or C++, he said.

It seemed to Wang that with some bindings and “syntactic sugar,” Python — not a variation of it, but the whole of it — could run in the browser without sacrificing compatibility with the rest of the ecosystem’s components. So Pyscript evolved from there.

“We were intrigued by some of the underlying work that was starting to happen around Python and WebAssembly.”

Anaconda CEO Peter Wang

“The difficulty with Python versus any other language is that a lot of Python’s power comes from its usage for data analysis and numerical computing, and that requires a very large, extensive and difficult to compile set of C and C++ and Fortran libraries or packages, we might call them,” he said. “So part of the big lift that only recently happened was [that] a lot of those libraries were ported to run on WebAssembly.”

That made it possible for Python and its data extension system to run directly in the browser as a first-class citizen alongside something like JavaScript, he said.

That big change made Pyscript possible. Anaconda introduced some additional opinionated framework bits, he said, with the vision that someone would be able to write an HTML tag, insert some Python code, and then close out the tag and it would simply work within the browser.

Right now, to run it, the code hits Anaconda’s servers to actually load the Pyscript runtime and packages. Once those are loaded into the user’s browser, however, there is no longer the need to connect to the server — it runs entirely locally in the browser, he explained.

“If you’re a developer, and you want to use Pyscript to ship your app, you would simply put the Pyscript artifacts, the runtime and the modules on your server,” he said. “When the user came to your server, they would then load it from you and then they will be running inside their browser tab.”

It’s actually a peer-to-peer application distribution mechanism that allows people to share applications with each other, he explained

”If they were in a completely disconnected environment, they would still be able to run full-fledged, bonafide web applications with all the Python stack, and they wouldn’t have to hit anyone’s server,” he said. “So in a way, it sort of points to a capability for Web3, but using Python to do the Web3 development.”

Pyscript is in alpha and is not production-ready, but Wang did feel it was ready enough to demo during his keynote at PyCon 2022.

What’s Next for Pyscript

Pyscript is still in alpha, but Anaconda plans to improve the speed of package loading and the size of the download, to make it snappier. It’s also working on increasing support to make it easy to build user interfaces with it. The team is also working on data IO and data persistence because the next step after building applications will be to connect to a database, he said. Within a few months, Pyscript will “have some really nice things out there” to support using the framework, he said.

The response from the Python community has been positive, Wang said, particularly from Python people who have seen the language struggle to be relevant in terms of building applications.

“They can see with Pyscript that now they have a way to just get stuff into people’s hands,” Wang said. “You find the people who really get what you’re trying to do, engage with them, and then keep building great things from there.”

TRENDING STORIES
Loraine Lawson is a veteran technology reporter who has covered technology issues from data integration to security for 25 years. Before joining The New Stack, she served as the editor of the banking technology site Bank Automation News. She has...
Read more from Loraine Lawson
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Anaconda.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.