pyscript/pyscript
Fork: 1394 Star: 17449 (更新于 2024-04-29 03:50:43)
license: Apache-2.0
Language: Python .
Try PyScript: https://pyscript.com Examples: https://tinyurl.com/pyscript-examples Community: https://discord.gg/HxvBtukrg2
最后发布版本: 2024.3.2 ( 2024-03-26 19:36:49)
PyScript
What is PyScript
Summary
PyScript is a framework that allows users to create rich Python applications in the browser using HTML's interface and the power of Pyodide, MicroPython and WASM, and modern web technologies.
To get started see the Beginning PyScript tutorial.
For examples see here.
Other useful resources:
- The official technical docs.
- Our current Home Page on the web.
- A free-to-use online editor for trying PyScript.
- Our community Discord Channel, to keep in touch .
Every Tuesday at 15:30 UTC there is the PyScript Community Call on zoom, where we can talk about PyScript development in the open. Most of the maintainers regularly participate in the call, and everybody is welcome to join.
Every other Thursday at 16:00 UTC there is the PyScript FUN call: this is a call in which everybody is encouraged to show what they did with PyScript.
For more details on how to join the calls and up to date schedule, consult the official calendar:
- Google calendar in UTC time;
- iCal format.
Longer Version
PyScript is a meta project that aims to combine multiple open technologies into a framework that allows users to create sophisticated browser applications with Python. It integrates seamlessly with the way the DOM works in the browser and allows users to add Python logic in a way that feels natural both to web and Python developers.
Try PyScript
To try PyScript, import the appropriate pyscript files into the <head>
tag of your html page:
<head>
<link
rel="stylesheet"
href="https://pyscript.net/releases/2023.11.2/core.css"
/>
<script
type="module"
src="https://pyscript.net/releases/2023.11.2/core.js"
></script>
</head>
<body>
<script type="py" terminal>
from pyscript import display
display("Hello World!") # this goes to the DOM
print("Hello terminal") # this goes to the terminal
</script>
</body>
You can then use PyScript components in your html page. PyScript currently offers various ways of running Python code:
-
<script type="py">
: can be used to define python code that is executable within the web page. -
<script type="py" src="hello.py">
: same as above, but the python source is fetched from the given URL. -
<script type="py" terminal>
: same as above, but also creates a terminal where to display stdout and stderr (e.g., the output ofprint()
);input()
does not work. -
<script type="py" terminal worker>
: run Python inside a web worker: the terminal is fully functional andinput()
works. -
<py-script>
: same as<script type="py">
, but it is not recommended because if the code contains HTML tags, they could be parsed wrongly. -
<script type="mpy">
: same as above but use MicroPython instead of Python.
Check out the official docs for more detailed documentation.
How to Contribute
Read the contributing guide to learn about our development process, reporting bugs and improvements, creating issues and asking questions.
Check out the developing process documentation for more information on how to setup your development environment.
Governance
The PyScript organization governance is documented in a separate repository.
最近版本更新:(数据更新于 2024-04-12 11:52:38)
2024-03-26 19:36:49 2024.3.2
2024-03-15 19:24:42 2024.3.1
2024-02-22 22:13:58 2024.2.1
2024-01-31 23:14:40 2024.1.3
2024-01-29 19:05:08 2024.1.2
2024-01-05 02:21:22 2024.1.1
2023-12-08 01:08:05 2023.12.1
2023-11-29 20:53:32 2023.11.2
2023-11-08 21:43:08 2023.11.1
2023-06-21 02:03:25 2023.05.1
主题(topics):
html, javascript, python, wasm
pyscript/pyscript同语言 Python最近更新仓库
2024-04-29 14:24:11 MetaCubeX/mihomo
2024-04-27 22:26:03 OpenMOSS/CoLLiE
2024-04-27 15:28:28 home-assistant/core
2024-04-27 09:20:24 jxxghp/MoviePilot
2024-04-27 01:55:30 Dao-AILab/flash-attention
2024-04-27 00:42:42 LmeSzinc/AzurLaneAutoScript