Issue
As I understand it, I should be able to print the variable foo
in the snippet below.
from IPython.display import HTML
HTML('''
<script type="text/javascript">
IPython.notebook.kernel.execute("foo=97")
</script>
''')
print(foo)
Instead, I see this error message:
NameErrorTraceback (most recent call last)
<ipython-input-2-91b73ee49ec6> in <module>()
5 </script>
6 ''')
----> 7 print(foo)
NameError: name 'foo' is not defined
I'm trying to use this answer but struggling to make it work.
FWIW, this is the latest Jupyter code (according to pip) running on Fedora 23. What are the prerequisites to make this work?
Solution
This is how I made your code work:
or even simpler:
Answered By - DevLounge
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.