I use VPython in a Jupyter environment, using a Python2 kernel (same happens with a VPython kernel)
I have a function thet renders a complex scene (~50 extrusion objects). When I call the function in a cell, it renders correctly, and returns the canvas object, so I can use it in the next cell to manipulate it.
However, when I perform a 'run all cells' in my notebook, jupyter does not wait for the cell with my function to finish, and already starts with the next cell, where the canvas object is obviously not available yet:
[4] my_canv = draw_my_scene(...)
[3] my_canv.camera.pos = ...
# this generates an error, because the cell above was not yet finished
I tried using canv.waitfor("draw_complete") in the draw_my_scene function, but this does not help.
Is there a way to make jupyter wait until the rendering is complete?