1 | initial version |
To add another possibility to the list,
%%javascript
var kernel = IPython.notebook.kernel;
var thename = window.document.getElementById("notebook_name").innerHTML;
var command = "theNotebook = " + "'"+thename+"'";
kernel.execute(command);
and print(theNotebook)
in a subsequent code cell produces the name of your notebook. But if you are working in a notebook and change its name, then for theNotebook variable to be updated the code containing the javascript magic has to be executed also.
2 | No.2 Revision |
To add another possibility to the list,
%%javascript
var kernel = IPython.notebook.kernel;
var thename = window.document.getElementById("notebook_name").innerHTML;
var command = "theNotebook = " + "'"+thename+"'";
kernel.execute(command);
and print(theNotebook)
in a subsequent code cell produces the name of your notebook. But if
If you are working in a notebook and change its name, then for theNotebook variable to be updated the code containing the javascript magic has to be executed also.
3 | No.3 Revision |
To add another possibility to the list,
%%javascript
var kernel = IPython.notebook.kernel;
var thename = window.document.getElementById("notebook_name").innerHTML;
var command = "theNotebook = " + "'"+thename+"'";
kernel.execute(command);
and print(theNotebook)
in a subsequent code cell produces the name of your notebook.
If you are working in a notebook and change its name, then for theNotebook variable to be updated the code containing the javascript magic has to be executed also.for theNotebook variable to be updated.