PyScript is a framework that combines the power of Pyodide, WASM, and contemporary web technologies with the HTML interface to let users build robust Python applications in the browser.
The PyScript programming language would not be possible without basing it on a recent version of Pyodide. Pyodide is an interpreter for the CPython language that has been compiled with Emscripten into WebAssembly. This enables Python to run in a web browser.
It is a single-page application (SPA) written in TypeScript using the Svelte framework styled with Tailwind CSS and bundled with rollup.js. According to one of the comments in an early Git commit.
PyScript is not trying to convert professional web developers. Instead, itβs designed for the 99% of web users who arenβt professional developers - Peter Wang [Anaconda co-founder and CEO]
Just like in every other language, Let's start with the hello world in PyScript.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello, World!</title>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
</head>
<body>
<py-script>print("Hello, World!")</py-script>
</body>
</html>
First, import the necessary PyScript's JS and CSS module, then get started by entering the content in the py-script
tag. Run the server and you will be able to see "Hello, World!" as a result.
Here's my repo that is curated for sharing and learning pyscript in one place. Check it out!
dotAadarsh / Everythings-PyScript
This repo is curated for sharing and learning pyscript in one place.
PyScript
This repo is curated for sharing and learning pyscript in one place.
Python in the Web Browser | programming for the 99%
- Official Website
βοΈ - Github Repo
βοΈ - Documentation
βοΈ - Community
βοΈ - Official Twitter handle
βοΈ
Articles π°
- Getting started with PyScript
βοΈ - A First Look at PyScript: Python in the Web Browser
βοΈ - How to Use PyScript β A Python Frontend Framework
βοΈ - Intro to PyScript: Run Python in the browser
βοΈ - PyScript β or rather Python in your browser + what can be done with it?
βοΈ
Podcasts π§
- #367: Say Hello to PyScript (WebAssembly Python) | Talk Python To Me | Spotify
βοΈ - S8:E7 - Faking DEI Efforts, Ruby at Scale, and Diving Into PyScript | DevNews | Spotify
βοΈ - Digging Into PyScript & Preventing or Handling Python Errors | The Real Python Podcast | Spotify
βοΈ
Videos π₯
- PyScript - Run Python in the Browserβ¦
Thanks for the read! Stay tuned!
Top comments (0)