PyScript unveiled at PyCon US 2022
Py, oh my! Web development with Python is easier than ever
Hey Grokking Python readers, and happy Wednesday!
What is PyScript?
Can interleave Python in HTML (like PHP)
Full access to the Python Standard Library
Can fully access the web page (DOM)
Is truly serverless
Enables 'import d3'
Requires ZERO installation
Is performant (includes utilizing GPU)
During a live coding demonstration, Wang impressed the crowd by embedding an interactive Python data visualization of NYC taxicabs in an HTML file in mere minutes.
Who is PyScript for?
If you've worked with Python, you may already know that trying to make desktop native applications with Python is frustrating, and making mobile native apps with Python is nearly impossible. This hurdle makes it difficult for Python developers to share their work with a broader audience.
Wang described the Python interpreter as having an under-the-hood engine "like a Honda Civic with mounting bolts for a warp drive." While just about anyone can learn Python syntax quickly, there is a steep learning curve to familiarizing yourself with the rich ecosystem of libraries and frameworks that make Python great.
PyScript flattens that learning curve dramatically.
Now, frontend web developers, Python developers, and data scientists will all be able to share models, dashboards, data visualizations, and more without learning additional infrastructure technology.
How to learn Python in 5 easy steps (for beginners) is a great article to read if you'd like to brush up on those Python skills.
How does PyScript work?
PyScript isn't a variation of the Python language. Instead, it combines multiple open source technologies to allow users to add logic and create sophisticated applications in the web browser.
PyScript works by compiling CPython to WebAssembly (WASM) and Emscripten via Pyodide. WASM is a low-level assembly-like language released in 2017 that provided a way for developers to run code written in languages like C++ or Rust on the web at near-native speeds.
You can take a look at some of the demos that were presented at PyCon down below.
PyCon US 2023
If you're a passionate Pythonista and would like to stay in the loop about future Python events, stick around. We're all lifelong learners here at Educative, and we want everyone to have access to great learning experiences.
The following PyCon US will be held in Salt Lake City, Utah, from April 19th to April 27th, 2023. We'll keep you posted when registration opens up, and we hope to see you there!