Skip to content

Feature: pre and post code #3

@JeffersGlass

Description

@JeffersGlass

It would be useful in some situations for the documentation writer to specify additional Python code to run immediately before and/or after the user's REPL code, for setup or teardown of other function/objects/imports that the user would need to make the example code run.

The API might be something like:

```py-pre
# setup code
from json import dump
```

```py 
# User's code block
from pyscript import display, document

def opened_picker(*args):
    display("You opened the color picker!")
```

```py-post
# teardown code
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions