Skip to content
Permalink
Browse files

update a notebook for ipython 3

  • Loading branch information...
sdpython committed May 14, 2015
1 parent 416d437 commit a3c0a0a33f31ca99db331686a044b0f5db07b448
Showing with 36 additions and 36 deletions.
  1. +36 −36 _doc/notebooks/having_a_form_in_a_notebook.ipynb
@@ -16,28 +16,11 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"<div style=\"background-color:gainsboro; width:500px; padding:10px;\">\n",
"<label>Variable Name: </label> \n",
"<input type=\"text\" id=\"var_name\" value=\"foo\" size=\"170\" />\n",
"<label>Variable Value: </label>\n",
"<input type=\"text\" id=\"var_value\" value=\"bar\" />\n",
"<br />\n",
"<button onclick=\"set_value()\">Set Value</button>\n",
"</div>\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
@@ -51,25 +34,42 @@
" var kernel = IPython.notebook.kernel;\n",
" kernel.execute(command);\n",
"}\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"<div style=\"background-color:gainsboro; width:500px; padding:10px;\">\n",
"<label>Variable Name: </label> \n",
"<input type=\"text\" id=\"var_name\" value=\"myvar\" size=\"170\" />\n",
"<label>Variable Value: </label>\n",
"<input type=\"text\" id=\"var_value\" value=\"myvalue\" />\n",
"<br />\n",
"<button onclick=\"set_value()\">Set Value</button>\n",
"</div>\n"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
"<IPython.core.display.HTML object>"
]
},
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from IPython.display import HTML, Javascript, display_html\n",
"from IPython.display import HTML, Javascript, display_html, display_javascript\n",
"\n",
"input_form = \"\"\"\n",
"<div style=\"background-color:gainsboro; width:500px; padding:10px;\">\n",
"<label>Variable Name: </label> \n",
"<input type=\"text\" id=\"var_name\" value=\"foo\" size=\"170\" />\n",
"<input type=\"text\" id=\"var_name\" value=\"myvar\" size=\"170\" />\n",
"<label>Variable Value: </label>\n",
"<input type=\"text\" id=\"var_value\" value=\"bar\" />\n",
"<input type=\"text\" id=\"var_value\" value=\"myvalue\" />\n",
"<br />\n",
"<button onclick=\"set_value()\">Set Value</button>\n",
"</div>\n",
@@ -87,24 +87,24 @@
"}\n",
"\"\"\"\n",
"\n",
"display_html(HTML(input_form))\n",
"Javascript(javascript)"
"display_javascript(Javascript(javascript))\n",
"HTML(input_form)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"'my value'"
"'myvalue'"
]
},
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
@@ -122,7 +122,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {
"collapsed": false
},
@@ -155,7 +155,7 @@
"<IPython.core.display.HTML object>"
]
},
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
@@ -168,18 +168,18 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"{'module': 'my_module', 'version': 'version2'}"
"{'module': 'fffff', 'version': 'v...'}"
]
},
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
@@ -272,7 +272,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {
"collapsed": false
},
@@ -304,10 +304,10 @@
"</script>"
],
"text/plain": [
"<IPython.core.display.HTML at 0x73b3730>"
"<IPython.core.display.HTML object>"
]
},
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}

0 comments on commit a3c0a0a

Please sign in to comment.
You can’t perform that action at this time.