.. _snappremierprojetnonviderst: ================================== Snap - partir d’un projet existant ================================== .. only:: html **Links:** :download:`notebook `, :downloadlink:`html `, :download:`PDF `, :download:`python `, :downloadlink:`slides `, :githublink:`GitHub|_doc/notebooks/scratch/snap_premier_projet_non_vide.ipynb|*` Snap ou Scratch dans un notebook. On s’assure d’abord que les fichiers javascript de *Snap* sont accessibles depuis le serveur IPython : .. code:: ipython3 from code_beatrix.jsscripts import copy_jstool2notebook %load_ext code_beatrix copy_jstool2notebook("snap") .. parsed-literal:: [('>+', , 'c:\\Python36_x64\\lib\\site-packages\\notebook-5.0.0-py3.6.egg\\notebook\\static\\snap'), ('>+', , 'c:\\Python36_x64\\lib\\site-packages\\notebook-5.0.0-py3.6.egg\\notebook\\static\\snap'), ('>+', , 'c:\\Python36_x64\\lib\\site-packages\\notebook-5.0.0-py3.6.egg\\notebook\\static\\snap'), ('>+', , 'c:\\Python36_x64\\lib\\site-packages\\notebook-5.0.0-py3.6.egg\\notebook\\static\\snap'), ('>+', , 'c:\\Python36_x64\\lib\\site-packages\\notebook-5.0.0-py3.6.egg\\notebook\\static\\snap'), ('>-', None, )] Si le résultat est une liste vide, cela signifie que cela a déjà été fait. .. code:: ipython3 %snap --help .. parsed-literal:: usage: snap [-h] [-f FILE] [-d DIV] [-W WIDTH] [-H HEIGHT] insert a snap window inside a notebook optional arguments: -h, --help show this help message and exit -f FILE, --file FILE scratch or snap file to display -d DIV, --div DIV id for the HTML div -W WIDTH, --width WIDTH window width -H HEIGHT, --height HEIGHT window height usage: snap [-h] [-f FILE] [-d DIV] [-W WIDTH] [-H HEIGHT] .. code:: ipython3 # pas encore parfait, il faut mieux utiliser l'autre notebook. from code_beatrix.jsscripts.nbsnap import RenderSnap RenderSnap() .. raw:: html
Snap showing up soon...
.. code:: ipython3 %snap .. raw:: html
Snap showing up soon...