liatemplates / pyodide Goto Github PK
View Code? Open in Web Editor NEWA template for using Pyodide in LiaScript
A template for using Pyodide in LiaScript
Hello! Thank you so much for your work on this template. It's fantastic! We're building several LiaScript courses using Pyodide now, and we've run into an issue that may be of interest to others as well.
For some executable code blocks, we'd like to provide additional pedagogical text when learners encounter errors --- in other words, we'd like a way to add a custom message below a code block if a user runs the code and receives an error, ideally in addition to the error handling already happening in the Pyodide.eval_ macro.
For example, we have courses where learners load the example data on one slide of the course and then use it throughout the following slides. If someone enters the course at a later slide (maybe if a friend sends them a link to that particular slide), or if they refresh the browser part way through a course, the data loaded on an earlier slide will no longer be available. Then when they try to execute a code block, it won't work (they'll get something like "NameError: name 'data' is not defined", which is suggestive but we could be much more helpful). So when we include executable code blocks that we know rely on code having been run previously in the course, it would be fantastic to be able to show a helpful message to that effect if they code returns an error.
It would be ideal to have the helpful message be regular liascript, rather than showing up in the console log for the code block (so we could include a hyperlink back to the slide with the code they need to run, for example).
I tried modifying the Pyodide.eval_ macro to return an output that would be a boolean indicating if the code ran successfully or not, but I wasn't able to get it to work. I was hoping to add a new smaller macro to that would that that as input and print a help message if true or just print nothing if false.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.