IPython Notebook Javascript: retrieve content from JavaScript variables
问题 Is there a way for a function (called by an IPython Notebook cell) to retrieve the content of a JavaScript variable (for example IPython.notebook.notebook_path which contains the path of the current notebook)? The following works well when written directly within a cell (for example, based on this question and its comments): from IPython.display import display,Javascript Javascript('IPython.notebook.kernel.execute("mypath = " + "\'"+IPython.notebook.notebook_path+"\'");') But that falls apart