Yeah, output right in the notebook is important. I'm wanting them to be able to do something like this in a cell:
for ship in myShip.radarScan():
if ship.is_enemy:
display([ship.type, ship.range, ship.bearing])
And then have that cells results always showing the current data as they play the game.I haven't used it much, but I believe you can do this by using (or more likely slightly extending) the init_cell nbextension.
https://jupyter-contrib-nbextensions.readthedocs.io/en/lates...
Oh, that's cool - it's just some javascript that's essentially clicking execute on the selected cells. That makes sense, and hacked up version of this could work fine! Thanks!
If you get this working my cousin teaches elementary school and I'd love to show it to her! Please upload it if you're feeling generous :)
I'll definitely post it to GitHub, and I'll do a Show HN after I've used it in class.
> And then have that cells results always showing the current data as they play the game.
display handles that you can update from elsewhere in the notebook might be of interest. Here's an example:
https://github.com/ipython/ipython/blob/master/examples/IPyt...
To do it more properly, however, you can have a post_save_hook for the whole notebook, which runs the code from whichever cells however often you want outside of the notebooks. Of course, this way you wont see the output in the notebook.