Hello World in PyScript - Pyscript Typing CST Test
Loading…
Hello World in PyScript — Pyscript Code
A basic PyScript example that prints 'Hello World' directly into a webpage using <py-script>.
<!DOCTYPE html>
<html>
<head>
<title>Hello PyScript</title>
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css">
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
</head>
<body>
<py-script>
print("Hello World")
</py-script>
</body>
</html>Pyscript Language Guide
PyScript is a framework that allows running Python code directly in web browsers using HTML and JavaScript integration. It bridges Python with the web platform, enabling interactive applications without traditional backend setup.
Primary Use Cases
- ▸Embedding Python code in web pages for interactivity
- ▸Educational platforms teaching Python in the browser
- ▸Interactive data visualizations with Python libraries
- ▸Prototyping web apps quickly using Python
- ▸Combining Python and JavaScript for hybrid applications
Notable Features
- ▸Write Python directly in HTML with `<py-script>` tags
- ▸Access JavaScript objects and browser APIs from Python
- ▸Support for popular Python libraries like NumPy, Pandas, and Matplotlib
- ▸Live code execution in browser without server
- ▸Integration with Pyodide for WebAssembly-based Python runtime
Origin & Creator
Created by Anaconda, Inc., first announced in 2022, inspired by the desire to make Python a first-class citizen for web development alongside JavaScript.
Industrial Note
Used in education, prototyping, and interactive demos; suitable for web-based Python experimentation but not yet a replacement for full-scale web frameworks.