# Python console embedded in docs

**URL:** <https://discuss.python.org/t/python-console-embedded-in-docs/38477>\
**Category:** Documentation\
**Created:** [November 11, 2023, 11:43pm UTC](https://discuss.python.org/t/python-console-embedded-in-docs/38477 "2023-11-11T23:43:54Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![maciek](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/maciek/32/596_2.png) [@maciek](https://discuss.python.org/u/maciek)\
**Post date:** [October 22, 2025, 4:51pm UTC](https://discuss.python.org/t/python-console-embedded-in-docs/38477/13 "2025-10-22T16:51:38Z")

</div>

I’ve published a rudimentary proof of concept using [PyScript](https://docs.pyscript.net/2025.10.1/user-guide/terminal/) (Pyodide underneath) in [a GitHub repo](https://github.com/m-aciek/interactive-docs-poc) and recorded a demo:

[![](https://us1.discourse-cdn.com/flex002/uploads/python1/original/3X/8/e/8ed02ac3c981017dc7f4a5e31e2cb185bbfea3f7.jpeg "Interactive Python docs POC 2025-10-22") ](https://www.youtube.com/watch?v=ZBZaR_F6nuA)

Current blocker for the project is handling of multiline input like while loops and functions definitions.

I’ve modified `copybutton` script to make the buttons send to code to the console. One can experiment with the console using either `document.querySelector("#console").process()` or `document.querySelector("#console").terminal` ([Xterm.js terminal object](https://xtermjs.org/docs/api/terminal/classes/terminal/)) in the developer console.

Docs and similar terminal projects:

- [Python terminal - PyScript](https://docs.pyscript.net/2025.10.1/user-guide/terminal/)
- [Pyodide Console](https://pyodide.org/en/stable/console-v2.html)
- [cpython/Tools/wasm/emscripten/web\_example\_pyrepl\_jspi at main · python/cpython · GitHub](https://github.com/python/cpython/tree/main/Tools/wasm/emscripten/web_example_pyrepl_jspi)

---

_[View the full topic](https://discuss.python.org/t/python-console-embedded-in-docs/38477)._
