-
-
Notifications
You must be signed in to change notification settings - Fork 225
Brython as a Python 3 interpreter for activecode for advanced exercises #1208
base: master
Are you sure you want to change the base?
Brython as a Python 3 interpreter for activecode for advanced exercises #1208
Conversation
…ecode-template Add the html elements as a template needed for Brython
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good. I will try it out in my dev environment before I merge, but I like what I see. Thanks.
In the last commit I have added support for the brython stdlib. Also I created a console to show the errors and prints on the same output. I tried using the JOBE server but as we are running Brython not Python, the JOBE server does not support when imports from the Brython stdlib are done. (e.g.
This can be found in the Brython documentation page
Here is a gif of how it's looking: |
I created an optional argument for activecode blocks called python3_interpreter. It can be used writing something like this:
I am working on a project called PyZombis. PyZombis is an spanish course to learn how to code in Python and it is being built using Runestone. We had issues making some advance exercises of the course that involves:
The third one might be solved using the SQL activecode option, but the first two could not be done with any of the Runestone's tool.
This PR gives a graphic alternative for runestone. The output shows an iframe in which you can append things with the browser module that Brython offers.
Note: The
print()
function show its output on the browser console. If there is any syntax error, it is also shown in this browser console. It would be a good idea to add a console as well for students to see their prints or mistakes in the same screen (AngelaRemolina#8)I have also created a PR on the PyZombis project, to use Runestone with this new implementation (see here). You can try out one exercise I did trying out this activecode block with Brython here: http://pyar.github.io/PyZombis/102/lectures/TWP45.html and here is also a gif of how it works (on an exercises that works with the Facebook API showing public profile photos):