Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Improve README and and mention the community calls #1858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 15, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions 29 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PyScript is a meta project that aims to combine multiple open technologies into

## Try PyScript

To try PyScript, import the appropriate pyscript files into the `<head>` tag of your html page with:
To try PyScript, import the appropriate pyscript files into the `<head>` tag of your html page:

```html
<head>
Expand All @@ -29,21 +29,40 @@ To try PyScript, import the appropriate pyscript files into the `<head>` tag of
src="https://pyscript.net/releases/2023.11.1/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 implements the following elements:
You can then use PyScript components in your html page. PyScript currently offers various ways of running Python code:

- `<py-script>`: can be used to define python code that is executable within the web page. The element itself is not rendered to the page and is only used to add logic
- `<py-repl>`: creates a REPL component that is rendered to the page as a code editor and allows users to write executable 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 of `print()`); `input()` does not work.
- `<script type="py" terminal worker>`: run Python inside a web worker: the terminal if fully functional and `input()` works.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you guys mind adding a reason (or pointer to one) about why a user would choose to run python in the worker instead of as main ?

- `<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 [the examples directory](examples) folder for more examples on how to use it, all you need to do is open them in Chrome.
Check out the [official docs](https://docs.pyscript.net) for more detailed documentation.

## How to Contribute

Read the [contributing guide](CONTRIBUTING.md) to learn about our development process, reporting bugs and improvements, creating issues and asking questions.

Check out the [developing process](https://docs.pyscript.net/latest/contributing) documentation for more information on how to setup your development environment.

## Community calls and events

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 Thurday 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.
antocuni marked this conversation as resolved.
Show resolved Hide resolved

For more details on how to join the calls and up to date schedule, consult the official [Google calendar](https://calendar.google.com/calendar/u/0/embed?src=d3afdd81f9c132a8c8f3290f5cc5966adebdf61017fca784eef0f6be9fd519e0@group.calendar.google.com&ctz=Europe/Berlin) page (also available in [iCal format](https://calendar.google.com/calendar/ical/d3afdd81f9c132a8c8f3290f5cc5966adebdf61017fca784eef0f6be9fd519e0%40group.calendar.google.com/public/basic.ics)).

## Resources

- [Official docs](https://docs.pyscript.net)
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.