|
1 | 1 | # PyScript
|
2 | 2 |
|
3 |
| -## What is PySc
8000
ript |
| 3 | +## PyScrcipt is an open source platform for Python in the browser. |
4 | 4 |
|
5 |
| -### Summary |
| 5 | +Using PyScript is as simple as: |
6 | 6 |
|
7 |
| -PyScript is a framework that allows users to create rich Python applications in the browser using HTML's interface and the power of [Pyodide](https://pyodide.org/en/stable/), [MicroPython](https://micropython.org/) and [WASM](https://webassembly.org/), and modern web technologies. |
| 7 | +```html |
| 8 | +<!doctype html> |
| 9 | +<html lang="en"> |
| 10 | + <head> |
| 11 | + <meta charset="utf-8" /> |
| 12 | + <meta name="viewport" content="width=device-width,initial-scale=1" /> |
| 13 | + <title>PyScript!</title> |
| 14 | + <link |
| 15 | + rel="stylesheet" |
| 16 | + href="https://pyscript.net/snapshots/2024.9.2/core.css" |
| 17 | + /> |
| 18 | + <script |
| 19 | + type="module" |
| 20 | + src="https://pyscript.net/snapshots/2024.9.2/core.js" |
| 21 | + ></script> |
| 22 | + </head> |
| 23 | + <body> |
| 24 | + <!-- Use MicroPython to evaluate some Python --> |
| 25 | + <script type="mpy" terminal> |
| 26 | + print("Hello, world!") |
| 27 | + </script> |
| 28 | + </body> |
| 29 | +</html> |
| 30 | +``` |
| 31 | + |
| 32 | +PyScript enables the creation of rich Python applications in the browser using |
| 33 | +[Pyodide](https://pyodide.org/en/stable/) (a version of |
| 34 | +[CPython](https://python.org/)), [MicroPython](https://micropython.org/), |
| 35 | +[WASM](https://webassembly.org/), and modern web technologies. It means Python |
| 36 | +now runs anywhere a browser runs: desktop, laptop, mobile, tablet, or any other |
| 37 | +browser enabled
B421
device. |
8 | 38 |
|
9 |
| -To get started see the [Beginning PyScript tutorial](https://docs.pyscript.net/latest/beginning-pyscript/). |
| 39 | +To start building, read the |
| 40 | +[Beginning PyScript tutorial](https://docs.pyscript.net/latest/beginning-pyscript/). |
10 | 41 |
|
11 |
| -For examples see [here](https://pyscript.com/@examples). |
| 42 | +For example applications, see [here](https://pyscript.com/@examples). |
12 | 43 |
|
13 | 44 | Other useful resources:
|
14 | 45 |
|
| 46 | +- Our [Home Page](https://pyscript.net/) as an open source project. |
15 | 47 | - The [official technical docs](https://docs.pyscript.net/).
|
16 |
| -- Our current [Home Page](https://pyscript.net/) on the web. |
17 |
| -- A free-to-use [online editor](https://pyscript.com/) for trying PyScript. |
18 |
| -- Our community [Discord Channel](https://discord.gg/BYB2kvyFwm), to keep in touch . |
| 48 | +- A [YouTube channel](https://www.youtube.com/@PyScriptTV) with helpful videos |
| 49 | + and community content. |
| 50 | +- A free-to-use [online IDE](https://pyscript.com/) for trying PyScript. |
| 51 | +- Our community [Discord Channel](https://discord.gg/BYB2kvyFwm), to keep in |
| 52 | + touch . |
19 | 53 |
|
20 |
| -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. |
| 54 | +Every Tuesday at 15:30 UTC there is the _PyScript Community Call_ on zoom, |
| 55 | +where we can talk about PyScript development in the open. Most of the |
| 56 | +maintainers regularly participate in the call, and everybody is welcome to |
| 57 | +join. This meeting is recorded and uploaded to our YouTube channel. |
21 | 58 |
|
22 |
| -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. |
| 59 | +Every other Thursday at 16:00 UTC there is the _PyScript FUN_ call: the focus |
| 60 | +of this call is to share fun projects, goofy hacks or clever uses of PyScript. |
| 61 | +It's a supportive, energetic and entertaining meeting. This meeting is also |
| 62 | +recorded and uploaded to our YouTube channel. |
23 | 63 |
|
24 |
| -For more details on how to join the calls and up to date schedule, consult the official calendar: |
| 64 | +For more details on how to join the calls and up to date schedule, consult the |
| 65 | +official calendar: |
25 | 66 |
|
26 | 67 | - [Google calendar](https://calendar.google.com/calendar/u/0/embed?src=d3afdd81f9c132a8c8f3290f5cc5966adebdf61017fca784eef0f6be9fd519e0@group.calendar.google.com&ctz=UTC) in UTC time;
|
27 | 68 | - [iCal format](https://calendar.google.com/calendar/ical/d3afdd81f9c132a8c8f3290f5cc5966adebdf61017fca784eef0f6be9fd519e0%40group.calendar.google.com/public/basic.ics).
|
28 | 69 |
|
29 |
| -### Longer Version |
30 |
| - |
31 |
| -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. |
32 |
| - |
33 |
| -## Try PyScript |
34 |
| - |
35 |
| -To try PyScript, import the appropriate pyscript files into the `<head>` tag of your html page: |
36 |
| - |
37 |
| -```html |
38 |
| -<head> |
39 |
| - <link |
40 |
| - rel="stylesheet" |
41 |
| - href="https://pyscript.net/releases/2024.8.2/core.css" |
42 |
| - /> |
43 |
| - <script |
44 |
| - type="module" |
45 |
| - src="https://pyscript.net/releases/2024.8.2/core.js" |
46 |
| - ></script> |
47 |
| -</head> |
48 |
| -<body> |
49 |
| - <script type="py" terminal> |
50 |
| - from pyscript import display |
51 |
| - display("Hello World!") # this goes to the DOM |
52 |
| - print("Hello terminal") # this goes to the terminal |
53 |
| - </script> |
54 |
| -</body> |
55 |
| -``` |
| 70 | +## Contribute |
56 | 71 |
|
57 |
| -You can then use PyScript components in your html page. PyScript currently offers various ways of running Python code: |
| 72 | +For technical details of the code, please see the [README](core/README) in the |
| 73 | +`core` directory. |
58 | 74 |
|
59 |
| -- `<script type="py">`: can be used to define python code that is executable within the web page. |
60 |
| -- `<script type="py" src="hello.py">`: same as above, but the python source is fetched from the given URL. |
61 |
| -- `<script type="py" terminal>`: same as above, but also creates a terminal where to display stdout and stderr (e.g., the output of `print()`); `input()` does not work. |
62 |
| -- `<script type="py" terminal worker>`: run Python inside a web worker: the terminal is fully functional and `input()` works. |
63 |
| -- `<py-script>`: same as `<script type="py">`, but it is not recommended because if the code contains HTML tags, they could be parsed wrongly. |
64 |
| -- `<script type="mpy">`: same as above but use MicroPython instead of Python. |
| 75 | +Read the [contributing guide](https://docs.pyscript.net/latest/contributing/) |
| 76 | +to learn about our development process, reporting bugs and improvements, |
| 77 | +creating issues and asking questions. |
65 | 78 |
|
66 |
| -Check out the [official docs](https://docs.pyscript.net/) for more detailed documentation. |
67 |
| - |
68 |
| -## How to Contribute |
69 |
| - |
70 |
| -Read the [contributing guide](https://docs.pyscript.net/latest/contributing/) to learn about our development process, reporting bugs and improvements, creating issues and asking questions. |
71 |
| - |
72 |
| -Check out the [developing process](https://docs.pyscript.net/latest/developers/) documentation for more information on how to setup your development environment. |
73 |
| - |
74 |
| -For technical details of the code, please see the [README](pyscript.core/README) in `pyscript.core`. |
| 79 | +Check out the [developing process](https://docs.pyscript.net/latest/developers/) |
| 80 | +documentation for more information on how to setup your development environment. |
75 | 81 |
|
76 | 82 | ## Governance
|
77 | 83 |
|
78 |
| -The [PyScript organization governance](https://github.com/pyscript/governance) is documented in a separate repository. |
79 |
| - |
80 |
| -## Release |
81 |
| - |
82 |
| -To cut a new release of PyScript simply |
83 |
| -[add a new release](https://github.com/pyscript/pyscript/releases) while |
84 |
| -remembering to write a comprehensive changelog. A [GitHub action](https://github.com/pyscript/pyscript/blob/main/.github/workflows/publish-release.yml) |
85 |
| -will kick in and ensure the release is described and deployed to a URL with the |
86 |
| -pattern: https://pyscript.net/releases/YYYY.M.v/ (year/month/version - as per |
87 |
| -our [CalVer](https://calver.org/) versioning scheme). |
88 |
| - |
89 |
| -Then, the following three separate repositories need updating: |
90 |
| - |
91 |
| -- [Documentation](https://github.com/pyscript/docs) - Change the `version.json` |
92 |
| - file in the root of the directory and then `node version-update.js`. |
93 |
| -- [Homepage](https://github.com/pyscript/pyscript.net) - Ensure the version |
94 |
| - referenced in `index.html` is the latest version. |
95 |
| -- [PSDC](https://pyscript.com) - Use discord or Anaconda Slack (if you work at |
96 |
| - Anaconda) to let the PSDC team know there's a new version, so they can update |
97 |
| - their project templates. |
| 84 | +The [PyScript organization governance](https://github.com/pyscript/governance) |
| 85 | +is documented in a separate repository. |
0 commit comments