mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 11:15:36 -05:00
* Deprecate pyscript output attribute * Update code blocks so they work * Small tweaks to styling and use html to warning * Fix broken test from bad conflict resolution * lowercase pyodide
31 lines
889 B
Markdown
31 lines
889 B
Markdown
# <py-repl>
|
|
|
|
The `<py-repl>` element provides a REPL(Read Eval Print Loop) to evaluate multi-line Python and display output.
|
|
|
|
## Attributes
|
|
|
|
| attribute | type | default | description |
|
|
|-------------------|---------|---------|---------------------------------------|
|
|
| **auto-generate** | boolean | | Auto-generates REPL after evaluation |
|
|
| **output** | string | | The element to write output into |
|
|
|
|
### Examples
|
|
|
|
#### `<py-repl>` element set to auto-generate
|
|
|
|
```html
|
|
<py-repl auto-generate="true"> </py-repl>
|
|
```
|
|
|
|
#### `<py-repl>` element with output
|
|
|
|
```html
|
|
<div id="replOutput"></div>
|
|
<py-repl output="replOutput">
|
|
hello = "Hello world!"
|
|
hello
|
|
</py-repl>
|
|
```
|
|
|
|
Note that if we `print` any element in the repl, the output will be printed in the [`py-terminal`](../plugins/py-terminal.md) if is enabled.
|