Created
April 1, 2013 19:28
-
-
Save juhasch/5287081 to your computer and use it in GitHub Desktop.
breakpoint-demo.ipynb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "breakpoint-demo" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Demo for breakpoint extension\n", | |
"---\n", | |
"The breakpoint extension allows you to run parts of a notebook. <br>\n", | |
"- You can set a breakpoint at any code cell by clicking at the \"In []:\" part of the cell.<br>\n", | |
"- If a breakpoint is activated, a small red circle will appear.<br>\n", | |
"- Breakpoints will be saved with the notebook.<br>\n", | |
"- You can execute cells from the current cell to the next breakpoint by clicking on the \"Run Until Breakpoint\" button at the toolbar.<br>\n", | |
"- You can clear all breakpoints by clicking on the \"Clear all breakpoints\" button at the toolbar.<br>" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"The breakpoint information is stored in the notebook metadata as:\n", | |
"<pre>\n", | |
"{\n", | |
" \"run_control\": {\n", | |
" \"breakpoint\": true\n", | |
" }\n", | |
"}\n", | |
"</pre>" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"# This is a codecell with a breakpoint\n", | |
"i=1" | |
], | |
"language": "python", | |
"metadata": { | |
"run_control": { | |
"breakpoint": true | |
} | |
}, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"run_control": { | |
"breakpoint": true | |
} | |
}, | |
"source": [ | |
"This is not a code cell" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"print 2*i" | |
], | |
"language": "python", | |
"metadata": { | |
"run_control": { | |
"breakpoint": false | |
} | |
}, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"i+=1\n", | |
"print i" | |
], | |
"language": "python", | |
"metadata": { | |
"run_control": { | |
"breakpoint": false | |
} | |
}, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"# This is a codecell with a breakpoint\n", | |
"i+=3\n", | |
"print i" | |
], | |
"language": "python", | |
"metadata": { | |
"run_control": { | |
"breakpoint": true | |
} | |
}, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"i+=5\n", | |
"print i" | |
], | |
"language": "python", | |
"metadata": { | |
"run_control": { | |
"breakpoint": false | |
} | |
}, | |
"outputs": [] | |
} | |
], | |
"metadata": {} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment