VOOZH about

URL: https://thenewstack.io/four-takeaways-from-pyscript-demo/

⇱ 4 Developer Takeaways from a Pyscript Demo - 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-09-30 11:34:12
4 Developer Takeaways from a Pyscript Demo
Frontend Development / Open Source / Software Development

4 Developer Takeaways from a Pyscript Demo

Pyscript works with or without JavaScript and offers the Python ecosystem inside HTML, explains a senior developer advocate from Anaconda.
Sep 30th, 2022 11:34am by Loraine Lawson
👁 Featued image for: 4 Developer Takeaways from a Pyscript Demo
Image via Shutterstock
“Wouldn’t it be cool if we could run Python in the browser,” asked Anaconda senior developer advocate Valerio Maggio during a recent webinar, “Rethinking Data Visualisation with pyscript.” He proceeded to demonstrate exactly how useful Pyscript, Anacando’s new language, could be by demonstrating the code with multiple data visualization tools. But first, he offered a developer’s perspective of what he’s learned about Pyscript. Here are four takeaways from his talk:

1. What the Heck Is Pyscript, Again?

Maggio spent a good deal of time really drilling into what Pyscript is and how it differs or does not differ from JavaScript and HTML — more on that below. As for the basics — what is Pyscript — he explained that it’s a client-side technology that doesn’t require a server. Strictly speaking, it’s implemented by a few lines of code in HTML to call Pyscript from Anaconda. You can download it or add some code to your page:
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
He noted it actually has two versions at this point — Alpha, which is frozen and more stable, or you can download the latest release. Anaconda is also pinning releases. Releases follow CalVer as a versioning convention, he added. “It’s a fantastic methodology to have Python finally working alongside JavaScript to do lots of things,” Maggio explained. “It’s an environment management system. It’s a flexible framework that allows you to create pluggable components.” He also addressed the why of Pyscript. “The potential to this technology is manyfold,” he said. “In essence, Pyscript is just HTML. But to just say that Pyscript is just HTML, it’s not entirely true, isn’t it? This is slightly more powerful […] than just HTML, because Pyscript brings the whole Python ecosystem directly into the browser. And the mission of this project is [enable] programming for the 99%.“ Of course, here’s the other thing about Pyscript, he reminded the audience: Pyscript is not ready for production as it’s still being developed.

2. Pycharm Supports Pyscript

If you’d prefer IDE support before you try Pyscript, Maggio recommended PyCharm, an IDE for Python. In fact, he used it to create the presentation seen during the webinar. “Pycharm has done a great job in supporting Pyscript syntax highlighting within the Pyscript times,” he said. “If you ask me, I would definitely recommend using PyCharm as the go-to solution to use Pyscript immediately. And to be fair, this is what I’ve been using to prepare for this presentation. It’s working perfectly.” The syntax highlighting within the Pyscript helps to make it easier to reuse code because, as he put it, “It would become cumbersome to have HTML, JavaScript and Python altogether and Python not highlighted properly.”

3. Pyscript Is Not a Javascript Replacement

Pyscript is a single-page application (SPA); from a more technical perspective it is just written in TypeScript, Maggio said. It’s not meant to be a JavaScript killer, he stressed. “What’s the deal here? What’s going on exactly?” he said. “Well, Pyscript allows the use of Python in the browser to build interactive web apps, something you would normally do at the moment with JavaScript. Pyscript allows you to work with or without JavaScript.” In fact, some of the demos he used in the webinar involved interacting directly with JavaScript, while others did not. It’s also more than Python, he added. “First off, a selling feature is Python in the browser; but it’s not just Python, the language in the browser, it is more like the Python ecosystem in the browser,” he said. “It’s Python with JavaScript.“

4. PHP Vibes

The first time Maggio saw Pyscript, it gave him “PHP vibes,” he confessed. It was a joke, he said, but he added a best practice of PHP is to use something else. “Are we really doing the dark side here? How are we going into the direction of making Python a new PHP, which by the way, means person on page anyway, […] so we really joined the dark side.” That made him take a more careful look at Pyscript. “I understood that it’s completely a whole new ecosystem in front of me,” he said.”The answer is very simple [but] is actually not, because Pyscript is much much more than that — it is absolutely [in] no way related to PHP kind of technology.” With Pyscript, developers can avoid mixing HTML and Python code if that bothers them — and it should bother them, he added. “It’s not a good practice mixing presentation and programming logic,” he said. “In Pyscript, you can actually have the Python code separated in a separated module, you can write everything in a timer.py. In this example, I’ve imported using the auto — see the source attribute in the pyscript time. So the Pyscript enables best practice.” He demoed the timer script:
# timer.py
from datetime import datetime
now = datetime.now()
now.strftime("%m/%d/%Y, %H:%M:%S")
<py-script src="./timer.py"></py-script>
It’s important to remember that Pyscript is also working within the web browser environment. When Maggio thinks of code in HTML, he thinks of JSP technology, he acknowledged. But that requires servers and, again, Pyscript is client-side technology so no server is required and no installation is required, he noted. If developers are bothered by the mixture of presentation and programming, bear in mind that, for better or worse, it’s the same thing that happens using JavaScript, he said. His full presentation provided more information on the Pyscript architecture, which is built atop Pyodide, a spinoff of the discontinued Mozilla Iodide project, and WASM. It also featured demos with Matplotlib, Seaborn, Bokeh, Panel and HvPlot, NetworkX and D3.js. He’s made the slides, complete with code links, available online in — what else — Pyscript.
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.