Can I use an HTML button to execute a PyScript REPL?

84 views Asked by At

There used to be a green 'play' button that was displayed at the bottom of a PyScript REPL element. This seems to have disappeared and the only option to execute the code is shift-enter.

Can I execute the code in the REPL by any other means, ideally via an HTML button?

I included a REPL in my code and the result did not show the execute button.

1

There are 1 answers

0
Alan Jones On BEST ANSWER

OK, not exactly solved but Jeff Glass has explained, in the comments, that this is a CSS issue and I've solved my particular problem by setting the default opacity of the button to 1 (opaque). This makes the button show up all the time. I.e. I put this in the HTML head.

<style>
    .py-repl-run-button {
        opacity: 1;
    }
</style>

I'm still not sure why the hover style doesn't work.