Grokking Python

Share this post
PyScript unveiled at PyCon US 2022
www.grokkingpython.com

PyScript unveiled at PyCon US 2022

Py, oh my! Web development with Python is easier than ever

May 4, 2022
7
Share this post
PyScript unveiled at PyCon US 2022
www.grokkingpython.com

Hey Grokking Python readers, and happy Wednesday!

Peter Wang, CEO of Anaconda, gave an exciting keynote speech at PyCon US 2022. He revealed PyScript, an ambitious project designed to make Python accessible and portable as HTML or JavaScript. PyScript is currently in alpha, but the future looks bright for data scientists and developers who want to build websites in Python.

Twitter avatar for @mariatta
Mariatta 🤦 @mariatta
#PyConUS2022 @pwang Keynote: Announcing Py-script!!! It's Python! inside HTML!!! 🤯
Image
4:00 PM ∙ Apr 30, 2022
11,184Likes2,240Retweets

What is PyScript?

PyScript is a Pythonic alternative to Scratch, JSFiddle, and other programming frameworks. It's a 100% client-side JavaScript web framework for creating interactive Python apps directly in the browser.

PyScript 

  • Can interleave Python in HTML (like PHP)

  • Full access to the Python Standard Library

  • Can fully access the web page (DOM)

  • Can call and be called by JavaScript libraries

  • 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. 

(Image source: https://anaconda.cloud/pyscript-python-in-the-browser)

Try PyScript

You can try PyScript by checking out their website or by visiting GitHub! If you'd like to build a simple webapp with PyScript, there’s a quick guide to get started.

Twitter avatar for @pwang
Peter Wang @pwang
PyScript is the #1 trending project on Github right now! Gratz @b_smoke @PhilippJFR!
github.comBuild software better, togetherGitHub is where people build software. More than 73 million people use GitHub to discover, fork, and contribute to over 200 million projects.
11:34 AM ∙ May 3, 2022
247Likes29Retweets

PyScript Demos

You can take a look at some of the demos that were presented at PyCon down below.

Basic examples

  • Hello World!

  • Simple clock

  • To-do list

MIME Rendering

  • Matplotlib

  • Altair

  • Folium

JavaScript Interaction

  • Simple d3 data visualization

  • Webgl Icosahedron

Visualizations

  • NYC Taxicab Demo

  • Fahrenheit to Celsius conversion

  • Fractals with NumPy and canvas

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! 

Share this post
PyScript unveiled at PyCon US 2022
www.grokkingpython.com
Comments
TopNew

No posts

Ready for more?

© 2023 Educative
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing