Files
markdown-exec/docs/usage/python.md
T
2022-05-09 23:30:03 +02:00

640 B

Python

Python console code

Code blocks syntax-highlighted with the pycon identifier are also supported. These code blocks will be pre-processed to keep only the lines starting with >>> , and the chevrons (prompt) will be removed from these lines, so we can execute them.

```pycon exec="1" source="console"
--8<-- "source.pycon"
```

It also means that multiple blocks of instructions will be concatenated, as well as their output:

```pycon exec="1" source="console"
--8<-- "multiple.pycon"
```