mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
README and getting started updates
This commit is contained in:
@@ -116,7 +116,13 @@ pyscript.write('pi', f'π is approximately {pi:.3f}')
|
|||||||
In addition to the [Python Standard Library](https://docs.python.org/3/library/) and
|
In addition to the [Python Standard Library](https://docs.python.org/3/library/) and
|
||||||
the `pyscript` module, many 3rd-party OSS packages will work out-of-the-box with PyScript.
|
the `pyscript` module, many 3rd-party OSS packages will work out-of-the-box with PyScript.
|
||||||
In order to use them you will need to delcare the dependencies using the `<py-env>` in the
|
In order to use them you will need to delcare the dependencies using the `<py-env>` in the
|
||||||
HTML head.
|
HTML head. You can also link to `.whl` files directly on disk like in our [toga example](https://github.com/pyscript/pyscript/blob/main/pyscriptjs/examples/toga/freedom.html)
|
||||||
|
|
||||||
|
```
|
||||||
|
<py-env>
|
||||||
|
- './static/wheels/travertino-0.1.3-py3-none-any.whl'
|
||||||
|
</py-env>
|
||||||
|
```
|
||||||
|
|
||||||
For example, NumPy and Matplotlib are available. Notice here we're using `<py-script output="plot">`
|
For example, NumPy and Matplotlib are available. Notice here we're using `<py-script output="plot">`
|
||||||
as a shortcut, which takes the expression on the last line of the script and runs `pyscript.write('plot', fig)`.
|
as a shortcut, which takes the expression on the last line of the script and runs `pyscript.write('plot', fig)`.
|
||||||
@@ -149,4 +155,6 @@ fig
|
|||||||
</py-script>
|
</py-script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If your `.whl` is not a pure Python wheel then open a PR or issue with [pyodide](https://github.com/pyodide/pyodide) to get it added here https://github.com/pyodide/pyodide/tree/main/packages
|
||||||
@@ -5,7 +5,9 @@
|
|||||||
### tl;dr
|
### tl;dr
|
||||||
PyScript is a Pythonic alternative to Scratch, JSFiddle or other "easy to use" programming frameworks, making the web a friendly, hackable, place where anyone can author interesting and interactive applications.
|
PyScript is a Pythonic alternative to Scratch, JSFiddle or other "easy to use" programming frameworks, making the web a friendly, hackable, place where anyone can author interesting and interactive applications.
|
||||||
|
|
||||||
To demonstrate pyscript, see [the pyscript folder](pyscriptjs/README.md).
|
To get started see [GETTING-STARTED][GETTING-STARTED.md]
|
||||||
|
|
||||||
|
For examples see [the pyscript folder](pyscriptjs/README.md).
|
||||||
|
|
||||||
### Longer Version
|
### Longer Version
|
||||||
PyScript is a meta project that aims to combine multiple open technologies to create a framework for users to use Python (and other languages) to create sophisticated applications in the browser. It highly integrate with the way the DOM works in the browser and allows users to add logic, in Python, in a way that feel natural to web as well as Python developers.
|
PyScript is a meta project that aims to combine multiple open technologies to create a framework for users to use Python (and other languages) to create sophisticated applications in the browser. It highly integrate with the way the DOM works in the browser and allows users to add logic, in Python, in a way that feel natural to web as well as Python developers.
|
||||||
@@ -28,9 +30,9 @@ Check out the `/examples` folder for more examples on how to use it, all you nee
|
|||||||
|
|
||||||
To contribute:
|
To contribute:
|
||||||
|
|
||||||
* clone the repo
|
* clone the repo `git clone https://github.com/pyscript/pyscript`
|
||||||
* cd into the main project folder with `cd pyscriptjs`
|
* cd into the main project folder with `cd pyscriptjs`
|
||||||
* install the dependencies with `npm install`
|
* install the dependencies with `npm install` - make sure to use npm version >= 16
|
||||||
* run `npm run dev` to build and run the dev server. This will also watch for changes and rebuild when a file is saved
|
* run `npm run dev` to build and run the dev server. This will also watch for changes and rebuild when a file is saved
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|||||||
Reference in New Issue
Block a user