-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Hooks not working on REPL Run button #2320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
what do you mean by "hooks don't work" ? also, we have a |
Hi, yes tried it but I want to Run some code after the Run button of REPL is pressed. (to test the written code in repl)
Any ideas why? |
could you please provide an extremely minimal example of what you are after? hooks have a different meaning in current PyScript and |
Here's a complete HTML file with a PyScript REPL that includes a test case when the student presses the Run button. This uses the
|
so ... you use |
sorry didn't quite understand you. I might have css in there but the main point is to run code on the event of pressing Run Repl button (more specifically after the code of repl have finished running). Is there such an event to hook onto in PyScript? |
pyscript has |
I would like the following scenario:
|
@limitcracker the last two points are too specific ... you can attach an event listener and do both or something else completely different, which is what we should offer, imho, we can't change code per each specific use case, I hope we agree there. Would a bubbling |
I am trying to
8000
get a working example with the solution you provide but really does not work! Thanks in advance! |
@limitcracker it doesn't work because it's not implemented yet ... |
Nice! Any ETA? Can I use any of the existing ones as alternative in the meanwhile? |
py-editor is a type a part, it shares nothing with py in terms of events and there is no event for what you need so ... I am afraid the answer is no |
MR up and running (linked above) ... it triggers a |
I am trying to use |
we haven't released yet |
tried a simple example but
|
@limitcracker ... we haven't released yet means: until we release, you will never see that event happening. We will release not this week but the next one, then you'll need to update and see that even happening. You don't even need to use 2 listeners as events bubble up ... you will have a top level (window) |
Sorry I saw this that's why I thought it was released. |
merged on main does not mean it's released ... we do have releases when we release, but I'll try to remember to directly notify this thread once that happens, apologies for the confusion. |
FYI we just released, apologies for the delay, thank you for your patience. That is: https://pyscript.net/releases/2025.5.1/core.js and https://pyscript.net/releases/2025.5.1/core.css |
Uh oh!
There was an error while loading. Please reload this page.
Checklist
What happened?
I want to make a student Python IDE using the default REPL of PyScript and when the student writes, runs his code to be able to test his code against premade test cases. I want also the test cases to not be visible to the student. But hooks do not work on
<script type="py-editor" env="test">
see full code below:Any ideas why ?
What browsers are you seeing the problem on? (if applicable)
No response
Console info
Additional Context
No response
The text was updated successfully, but these errors were encountered: