pass on IPython Kernel example notebooks...
Min RK -
r20547:8f4e2b41
Not Reviewed
Show More
Add another comment
TODOs: 0 unresolved 0 Resolved
COMMENTS: 0 General 0 Inline

The requested changes are too big and content was truncated. Show full diff

@@ -4,7 +4,7
4 "cell_type": "markdown",
4 "cell_type": "markdown",
5 "metadata": {},
5 "metadata": {},
6 "source": [
6 "source": [
7 "# Simple animations Using clear_output"
7 "# Simple Animations Using clear_output"
8 ]
8 ]
9 },
9 },
10 {
10 {
@@ -36,9 +36,9
36 "def printfunc(interval=1, reps=5):\n",
36 "def printfunc(interval=1, reps=5):\n",
37 " for n in range(reps):\n",
37 " for n in range(reps):\n",
38 " time.sleep(interval)\n",
38 " time.sleep(interval)\n",
39 " print 'In the background...', n\n",
39 " print('In the background... %i' % n)\n",
40 " sys.stdout.flush()\n",
40 " sys.stdout.flush()\n",
41 " print 'All done!'\n",
41 " print('All done!')\n",
42 " sys.stdout.flush()"
42 " sys.stdout.flush()"
43 ]
43 ]
44 },
44 },
@@ -53,7 +53,7
53 },
53 },
54 {
54 {
55 "cell_type": "code",
55 "cell_type": "code",
56 "execution_count": 10,
56 "execution_count": 2,
57 "metadata": {
57 "metadata": {
58 "collapsed": false
58 "collapsed": false
59 },
59 },
@@ -73,7 +73,7
73 "<BackgroundJob #3: printfunc(1,3)>"
73 "<BackgroundJob #3: printfunc(1,3)>"
74 ]
74 ]
75 },
75 },
76 "execution_count": 10,
76 "execution_count": 2,
77 "metadata": {},
77 "metadata": {},
78 "output_type": "execute_result"
78 "output_type": "execute_result"
79 },
79 },
@@ -106,7 +106,7
106 },
106 },
107 {
107 {
108 "cell_type": "code",
108 "cell_type": "code",
109 "execution_count": 11,
109 "execution_count": 3,
110 "metadata": {
110 "metadata": {
111 "collapsed": false
111 "collapsed": false
112 },
112 },
@@ -116,8 +116,8
116 "output_type": "stream",
116 "output_type": "stream",
117 "text": [
117 "text": [
118 "Completed jobs:\n",
118 "Completed jobs:\n",
119 "0 : <function sleepfunc at 0x314f848>\n",
119 "0 : <function sleepfunc at 0x10521f2f0>\n",
120 "2 : <function sleepfunc at 0x314f848>\n",
120 "2 : <function sleepfunc at 0x10521f2f0>\n",
121 "3 : printfunc(1,3)\n",
121 "3 : printfunc(1,3)\n",
122 "\n"
122 "\n"
123 ]
123 ]
@@ -136,7 +136,7
136 },
136 },
137 {
137 {
138 "cell_type": "code",
138 "cell_type": "code",
139 "execution_count": 12,
139 "execution_count": 4,
140 "metadata": {
140 "metadata": {
141 "collapsed": false
141 "collapsed": false
142 },
142 },
@@ -147,7 +147,7
147 "{'args': (), 'interval': 4, 'kwargs': {}}"
147 "{'args': (), 'interval': 4, 'kwargs': {}}"
148 ]
148 ]
149 },
149 },
150 "execution_count": 12,
150 "execution_count": 4,
151 "metadata": {},
151 "metadata": {},
152 "output_type": "execute_result"
152 "output_type": "execute_result"
153 }
153 }
@@ -172,7 +172,7
172 },
172 },
173 {
173 {
174 "cell_type": "code",
174 "cell_type": "code",
175 "execution_count": 13,
175 "execution_count": 5,
176 "metadata": {
176 "metadata": {
177 "collapsed": false
177 "collapsed": false
178 },
178 },
@@ -204,7 +204,7
204 },
204 },
205 {
205 {
206 "cell_type": "code",
206 "cell_type": "code",
207 "execution_count": 14,
207 "execution_count": 6,
208 "metadata": {
208 "metadata": {
209 "collapsed": false
209 "collapsed": false
210 },
210 },
@@ -216,12 +216,12
216 "Status of diejob1: Dead (Exception), call jobs.traceback() for details\n",
216 "Status of diejob1: Dead (Exception), call jobs.traceback() for details\n",
217 "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n",
217 "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n",
218 "\u001b[1;31mException\u001b[0m Traceback (most recent call last)\n",
218 "\u001b[1;31mException\u001b[0m Traceback (most recent call last)\n",
219 "\u001b[1;32m/home/fperez/usr/opt/virtualenv/ipython-0.13.2/lib/python2.7/site-packages/IPython/lib/backgroundjobs.pyc\u001b[0m in \u001b[0;36mcall\u001b[1;34m(self)\u001b[0m\n",
219 "\u001b[1;32m/Users/minrk/dev/ip/mine/IPython/lib/backgroundjobs.py\u001b[0m in \u001b[0;36mcall\u001b[1;34m(self)\u001b[0m\n",
220 "\u001b[0;32m 482\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
220 "\u001b[0;32m 489\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
221 "\u001b[0;32m 483\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mcall\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
221 "\u001b[0;32m 490\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mcall\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
222 "\u001b[1;32m--> 484\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
222 "\u001b[1;32m--> 491\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
223 "\u001b[0m\n",
223 "\u001b[0m\n",
224 "\u001b[1;32m<ipython-input-1-fbbbd0d2a1c3>\u001b[0m in \u001b[0;36mdiefunc\u001b[1;34m(interval, *a, **kw)\u001b[0m\n",
224 "\u001b[1;32m<ipython-input-1-169e49434ce0>\u001b[0m in \u001b[0;36mdiefunc\u001b[1;34m(interval, *a, **kw)\u001b[0m\n",
225 "\u001b[0;32m 13\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mdiefunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0minterval\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkw\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
225 "\u001b[0;32m 13\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mdiefunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0minterval\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkw\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
226 "\u001b[0;32m 14\u001b[0m \u001b[0mtime\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msleep\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0minterval\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
226 "\u001b[0;32m 14\u001b[0m \u001b[0mtime\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msleep\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0minterval\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
227 "\u001b[1;32m---> 15\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mException\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Dead job with interval %s\"\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0minterval\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
227 "\u001b[1;32m---> 15\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mException\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Dead job with interval %s\"\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0minterval\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
@@ -233,7 +233,7
233 }
233 }
234 ],
234 ],
235 "source": [
235 "source": [
236 "print \"Status of diejob1:\", diejob1.status\n",
236 "print(\"Status of diejob1: %s\" % diejob1.status)\n",
237 "diejob1.traceback() # jobs.traceback(4) would also work here, with the job number"
237 "diejob1.traceback() # jobs.traceback(4) would also work here, with the job number"
238 ]
238 ]
239 },
239 },
@@ -246,7 +246,7
246 },
246 },
247 {
247 {
248 "cell_type": "code",
248 "cell_type": "code",
249 "execution_count": 15,
249 "execution_count": 7,
250 "metadata": {
250 "metadata": {
251 "collapsed": false
251 "collapsed": false
252 },
252 },
@@ -255,15 +255,15
255 "name": "stdout",
255 "name": "stdout",
256 "output_type": "stream",
256 "output_type": "stream",
257 "text": [
257 "text": [
258 "Traceback for: <BackgroundJob #4: <function diefunc at 0x314f668>>\n",
258 "Traceback for: <BackgroundJob #4: <function diefunc at 0x10521f7b8>>\n",
259 "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n",
259 "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n",
260 "\u001b[1;31mException\u001b[0m Traceback (most recent call last)\n",
260 "\u001b[1;31mException\u001b[0m Traceback (most recent call last)\n",
261 "\u001b[1;32m/home/fperez/usr/opt/virtualenv/ipython-0.13.2/lib/python2.7/site-packages/IPython/lib/backgroundjobs.pyc\u001b[0m in \u001b[0;36mcall\u001b[1;34m(self)\u001b[0m\n",
261 "\u001b[1;32m/Users/minrk/dev/ip/mine/IPython/lib/backgroundjobs.py\u001b[0m in \u001b[0;36mcall\u001b[1;34m(self)\u001b[0m\n",
262 "\u001b[0;32m 482\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
262 "\u001b[0;32m 489\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
263 "\u001b[0;32m 483\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mcall\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
263 "\u001b[0;32m 490\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mcall\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
264 "\u001b[1;32m--> 484\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
264 "\u001b[1;32m--> 491\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
265 "\u001b[0m\n",
265 "\u001b[0m\n",
266 "\u001b[1;32m<ipython-input-1-fbbbd0d2a1c3>\u001b[0m in \u001b[0;36mdiefunc\u001b[1;34m(interval, *a, **kw)\u001b[0m\n",
266 "\u001b[1;32m<ipython-input-1-169e49434ce0>\u001b[0m in \u001b[0;36mdiefunc\u001b[1;34m(interval, *a, **kw)\u001b[0m\n",
267 "\u001b[0;32m 13\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mdiefunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0minterval\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkw\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
267 "\u001b[0;32m 13\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mdiefunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0minterval\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkw\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
268 "\u001b[0;32m 14\u001b[0m \u001b[0mtime\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msleep\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0minterval\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
268 "\u001b[0;32m 14\u001b[0m \u001b[0mtime\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msleep\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0minterval\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
269 "\u001b[1;32m---> 15\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mException\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Dead job with interval %s\"\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0minterval\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
269 "\u001b[1;32m---> 15\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mException\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Dead job with interval %s\"\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0minterval\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
@@ -272,15 +272,15
272 "\n",
272 "\n",
273 "\u001b[1;31mException\u001b[0m: Dead job with interval 1\n",
273 "\u001b[1;31mException\u001b[0m: Dead job with interval 1\n",
274 "\n",
274 "\n",
275 "Traceback for: <BackgroundJob #5: <function diefunc at 0x314f668>>\n",
275 "Traceback for: <BackgroundJob #5: <function diefunc at 0x10521f7b8>>\n",
276 "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n",
276 "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n",
277 "\u001b[1;31mException\u001b[0m Traceback (most recent call last)\n",
277 "\u001b[1;31mException\u001b[0m Traceback (most recent call last)\n",
278 "\u001b[1;32m/home/fperez/usr/opt/virtualenv/ipython-0.13.2/lib/python2.7/site-packages/IPython/lib/backgroundjobs.pyc\u001b[0m in \u001b[0;36mcall\u001b[1;34m(self)\u001b[0m\n",
278 "\u001b[1;32m/Users/minrk/dev/ip/mine/IPython/lib/backgroundjobs.py\u001b[0m in \u001b[0;36mcall\u001b[1;34m(self)\u001b[0m\n",
279 "\u001b[0;32m 482\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
279 "\u001b[0;32m 489\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
280 "\u001b[0;32m 483\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mcall\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
280 "\u001b[0;32m 490\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mcall\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
281 "\u001b[1;32m--> 484\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
281 "\u001b[1;32m--> 491\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
282 "\u001b[0m\n",
282 "\u001b[0m\n",
283 "\u001b[1;32m<ipython-input-1-fbbbd0d2a1c3>\u001b[0m in \u001b[0;36mdiefunc\u001b[1;34m(interval, *a, **kw)\u001b[0m\n",
283 "\u001b[1;32m<ipython-input-1-169e49434ce0>\u001b[0m in \u001b[0;36mdiefunc\u001b[1;34m(interval, *a, **kw)\u001b[0m\n",
284 "\u001b[0;32m 13\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mdiefunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0minterval\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkw\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
284 "\u001b[0;32m 13\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mdiefunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0minterval\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkw\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
285 "\u001b[0;32m 14\u001b[0m \u001b[0mtime\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msleep\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0minterval\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
285 "\u001b[0;32m 14\u001b[0m \u001b[0mtime\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msleep\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0minterval\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
286 "\u001b[1;32m---> 15\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mException\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Dead job with interval %s\"\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0minterval\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
286 "\u001b[1;32m---> 15\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mException\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Dead job with interval %s\"\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0minterval\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
@@ -305,7 +305,7
305 },
305 },
306 {
306 {
307 "cell_type": "code",
307 "cell_type": "code",
308 "execution_count": 16,
308 "execution_count": 8,
309 "metadata": {
309 "metadata": {
310 "collapsed": false
310 "collapsed": false
311 },
311 },
@@ -332,7 +332,7
332 },
332 },
333 {
333 {
334 "cell_type": "code",
334 "cell_type": "code",
335 "execution_count": 17,
335 "execution_count": 9,
336 "metadata": {
336 "metadata": {
337 "collapsed": true
337 "collapsed": true
338 },
338 },
@@ -350,7 +350,7
350 },
350 },
351 {
351 {
352 "cell_type": "code",
352 "cell_type": "code",
353 "execution_count": 18,
353 "execution_count": 10,
354 "metadata": {
354 "metadata": {
355 "collapsed": false
355 "collapsed": false
356 },
356 },
This diff has been collapsed as it changes many lines, (1618 lines changed) Show them Hide them
@@ -55,7 +55,7
55 }
55 }
56 ],
56 ],
57 "source": [
57 "source": [
58 "print \"Hi\""
58 "print(\"Hi\")"
59 ]
59 ]
60 },
60 },
61 {
61 {
@@ -167,7 +167,7
167 },
167 },
168 {
168 {
169 "cell_type": "code",
169 "cell_type": "code",
170 "execution_count": 8,
170 "execution_count": null,
171 "metadata": {
171 "metadata": {
172 "collapsed": false
172 "collapsed": false
173 },
173 },
@@ -337,9 +337,11
337 }
337 }
338 ],
338 ],
339 "source": [
339 "source": [
340 "print 'last output:', _\n",
340 "from __future__ import print_function\n",
341 "print 'next one :', __\n",
341 "\n",
342 "print 'and next :', ___"
342 "print('last output:', _)\n",
343 "print('next one :', __)\n",
344 "print('and next :', ___)"
343 ]
345 ]
344 },
346 },
345 {
347 {
@@ -355,7 +357,7
355 {
357 {
356 "data": {
358 "data": {
357 "text/plain": [
359 "text/plain": [
358 "u'_10 == Out[10]'"
360 "'_10 == Out[10]'"
359 ]
361 ]
360 },
362 },
361 "execution_count": 13,
363 "execution_count": 13,
@@ -377,7 +379,7
377 {
379 {
378 "data": {
380 "data": {
379 "text/plain": [
381 "text/plain": [
380 "u'In[11]'"
382 "'In[11]'"
381 ]
383 ]
382 },
384 },
383 "execution_count": 14,
385 "execution_count": 14,
@@ -399,7 +401,7
399 {
401 {
400 "data": {
402 "data": {
401 "text/plain": [
403 "text/plain": [
402 "u'In[11]'"
404 "'In[11]'"
403 ]
405 ]
404 },
406 },
405 "execution_count": 15,
407 "execution_count": 15,
@@ -432,9 +434,9
432 }
434 }
433 ],
435 ],
434 "source": [
436 "source": [
435 "print 'last input:', _i\n",
437 "print('last input:', _i)\n",
436 "print 'next one :', _ii\n",
438 "print('next one :', _ii)\n",
437 "print 'and next :', _iii"
439 "print('and next :', _iii)"
438 ]
440 ]
439 },
441 },
440 {
442 {
@@ -448,7 +450,7
448 "name": "stdout",
450 "name": "stdout",
449 "output_type": "stream",
451 "output_type": "stream",
450 "text": [
452 "text": [
451 " 1: print \"Hi\"\n",
453 " 1: print(\"Hi\")\n",
452 " 2: ?\n",
454 " 2: ?\n",
453 " 3:\n",
455 " 3:\n",
454 "import collections\n",
456 "import collections\n",
@@ -497,7 +499,7
497 "name": "stdout",
499 "name": "stdout",
498 "output_type": "stream",
500 "output_type": "stream",
499 "text": [
501 "text": [
500 "/home/fperez/ipython/tutorial/notebooks\r\n"
502 "/Users/minrk/dev/ip/mine/examples/IPython Kernel\r\n"
501 ]
503 ]
502 }
504 }
503 ],
505 ],
@@ -517,14 +519,14
517 "output_type": "stream",
519 "output_type": "stream",
518 "text": [
520 "text": [
519 "My current directory's files:\n",
521 "My current directory's files:\n",
520 "['BackgroundJobs.ipynb', 'Custom Display Logic.ipynb', 'Customizing IPython - Condensed.ipynb', 'Customizing IPython - Config.ipynb', 'Customizing IPython - Extensions.ipynb', 'Customizing IPython - Magics.ipynb', 'data', 'figs', 'flare.json', 'Index.ipynb', 'Interactive Widgets.ipynb', 'IPython - beyond plain Python.ipynb', 'kernel-embedding', 'Markdown Cells.ipynb', 'myscript.py', 'nbconvert_arch.png', 'NbConvert from command line.ipynb', 'NbConvert Python library.ipynb', 'Notebook and javascript extension.ipynb', 'Notebook Basics.ipynb', 'Overview of IPython.parallel.ipynb', 'parallel', 'Rich Display System.ipynb', 'Running a Secure Public Notebook.ipynb', 'Running Code.ipynb', 'Sample.ipynb', 'soln', 'Terminal usage.ipynb', 'text_analysis.py', 'Typesetting Math Using MathJax.ipynb']\n"
522 "['Animations Using clear_output.ipynb', 'Background Jobs.ipynb', 'Beyond Plain Python.ipynb', 'Capturing Output.ipynb', 'Cell Magics.ipynb', 'Custom Display Logic.ipynb', 'Index.ipynb', 'Old Custom Display Logic.ipynb', 'Plotting in the Notebook.ipynb', 'Raw Input in the Notebook.ipynb', 'Rich Output.ipynb', 'Script Magics.ipynb', 'SymPy.ipynb', 'Terminal Usage.ipynb', 'Third Party Rich Output.ipynb', 'Trapezoid Rule.ipynb', 'Working With External Code.ipynb', '__pycache__', 'data', 'example-demo.py', 'gui', 'ipython-completion.bash', 'ipython-get-history.py', 'ipython-qtconsole.desktop', 'ipython.desktop', 'mod.py', 'test.txt']\n"
521 ]
523 ]
522 }
524 }
523 ],
525 ],
524 "source": [
526 "source": [
525 "files = !ls\n",
527 "files = !ls\n",
526 "print \"My current directory's files:\"\n",
528 "print(\"My current directory's files:\")\n",
527 "print files"
529 "print(files)"
528 ]
530 ]
529 },
531 },
530 {
532 {
@@ -538,7 +540,7
538 "name": "stdout",
540 "name": "stdout",
539 "output_type": "stream",
541 "output_type": "stream",
540 "text": [
542 "text": [
541 "[BackgroundJobs.ipynb, Custom Display Logic.ipynb, Customizing IPython - Condensed.ipynb, Customizing IPython - Config.ipynb, Customizing IPython - Extensions.ipynb, Customizing IPython - Magics.ipynb, data, figs, flare.json, Index.ipynb, Interactive Widgets.ipynb, IPython - beyond plain Python.ipynb, kernel-embedding, Markdown Cells.ipynb, myscript.py, nbconvert_arch.png, NbConvert from command line.ipynb, NbConvert Python library.ipynb, Notebook and javascript extension.ipynb, Notebook Basics.ipynb, Overview of IPython.parallel.ipynb, parallel, Rich Display System.ipynb, Running a Secure Public Notebook.ipynb, Running Code.ipynb, Sample.ipynb, soln, Terminal usage.ipynb, text_analysis.py, Typesetting Math Using MathJax.ipynb]\r\n"
543 "[Animations Using clear_output.ipynb, Background Jobs.ipynb, Beyond Plain Python.ipynb, Capturing Output.ipynb, Cell Magics.ipynb, Custom Display Logic.ipynb, Index.ipynb, Old Custom Display Logic.ipynb, Plotting in the Notebook.ipynb, Raw Input in the Notebook.ipynb, Rich Output.ipynb, Script Magics.ipynb, SymPy.ipynb, Terminal Usage.ipynb, Third Party Rich Output.ipynb, Trapezoid Rule.ipynb, Working With External Code.ipynb, __pycache__, data, example-demo.py, gui, ipython-completion.bash, ipython-get-history.py, ipython-qtconsole.desktop, ipython.desktop, mod.py, test.txt]\r\n"
542 ]
544 ]
543 }
545 }
544 ],
546 ],
@@ -557,7 +559,7
557 "name": "stdout",
559 "name": "stdout",
558 "output_type": "stream",
560 "output_type": "stream",
559 "text": [
561 "text": [
560 "BACKGROUNDJOBS.IPYNB\r\n"
562 "ANIMATIONS USING CLEAR_OUTPUT.IPYNB\r\n"
561 ]
563 ]
562 }
564 }
563 ],
565 ],
@@ -574,7 +576,7
574 },
576 },
575 {
577 {
576 "cell_type": "code",
578 "cell_type": "code",
577 "execution_count": 27,
579 "execution_count": 22,
578 "metadata": {
580 "metadata": {
579 "collapsed": false
581 "collapsed": false
580 },
582 },
@@ -583,36 +585,33
583 "name": "stdout",
585 "name": "stdout",
584 "output_type": "stream",
586 "output_type": "stream",
585 "text": [
587 "text": [
586 "00 - BackgroundJobs\r\n",
588 "00 - Animations Using clear_output\n",
587 "01 - Custom Display Logic\r\n",
589 "01 - Background Jobs\n",
588 "02 - Customizing IPython - Condensed\r\n",
590 "02 - Beyond Plain Python\n",
589 "03 - Customizing IPython - Config\r\n",
591 "03 - Capturing Output\n",
590 "04 - Customizing IPython - Extensions\r\n",
592 "04 - Cell Magics\n",
591 "05 - Customizing IPython - Magics\r\n",
593 "05 - Custom Display Logic\n",
594 "06 - Index\n",
595 "07 - Old Custom Display Logic\n",
596 "08 - Plotting in the Notebook\n",
597 "09 - Raw Input in the Notebook\n",
598 "10 - Rich Output\n",
599 "11 - Script Magics\n",
600 "12 - SymPy\n",
601 "13 - Terminal Usage\n",
602 "14 - Third Party Rich Output\n",
603 "15 - Trapezoid Rule\n",
604 "16 - Working With External Code\n",
592 "--\n",
605 "--\n",
593 "--\n",
606 "--\n",
594 "--\n",
607 "--\n",
595 "09 - Index\r\n",
596 "10 - Interactive Widgets\r\n",
597 "11 - IPython - beyond plain Python\r\n",
598 "--\n",
608 "--\n",
599 "13 - Markdown Cells\r\n",
600 "--\n",
609 "--\n",
601 "--\n",
610 "--\n",
602 "16 - NbConvert from command line\r\n",
603 "17 - NbConvert Python library\r\n",
604 "18 - Notebook and javascript extension\r\n",
605 "19 - Notebook Basics\r\n",
606 "20 - Overview of IPython.parallel\r\n",
607 "--\n",
611 "--\n",
608 "22 - Rich Display System\r\n",
609 "23 - Running a Secure Public Notebook\r\n",
610 "24 - Running Code\r\n",
611 "25 - Sample\r\n",
612 "--\n",
612 "--\n",
613 "27 - Terminal usage\r\n",
614 "--\n",
613 "--\n",
615 "29 - Typesetting Math Using MathJax\r\n"
614 "--\n"
616 ]
615 ]
617 }
616 }
618 ],
617 ],
@@ -622,7 +621,7
622 " if f.endswith('ipynb'):\n",
621 " if f.endswith('ipynb'):\n",
623 " !echo {\"%02d\" % i} - \"{os.path.splitext(f)[0]}\"\n",
622 " !echo {\"%02d\" % i} - \"{os.path.splitext(f)[0]}\"\n",
624 " else:\n",
623 " else:\n",
625 " print '--'"
624 " print('--')"
626 ]
625 ]
627 },
626 },
628 {
627 {
@@ -645,7 +644,7
645 },
644 },
646 {
645 {
647 "cell_type": "code",
646 "cell_type": "code",
648 "execution_count": 28,
647 "execution_count": 23,
649 "metadata": {
648 "metadata": {
650 "collapsed": false
649 "collapsed": false
651 },
650 },
@@ -663,7 +662,7
663 },
662 },
664 {
663 {
665 "cell_type": "code",
664 "cell_type": "code",
666 "execution_count": 29,
665 "execution_count": 24,
667 "metadata": {
666 "metadata": {
668 "collapsed": false
667 "collapsed": false
669 },
668 },
@@ -672,17 +671,17
672 "name": "stdout",
671 "name": "stdout",
673 "output_type": "stream",
672 "output_type": "stream",
674 "text": [
673 "text": [
675 "10000000 loops, best of 3: 190 ns per loop\n"
674 "10000 loops, best of 3: 19.3 µs per loop\n"
676 ]
675 ]
677 }
676 }
678 ],
677 ],
679 "source": [
678 "source": [
680 "%timeit range(10)"
679 "%timeit list(range(1000))"
681 ]
680 ]
682 },
681 },
683 {
682 {
684 "cell_type": "code",
683 "cell_type": "code",
685 "execution_count": 30,
684 "execution_count": 25,
686 "metadata": {
685 "metadata": {
687 "collapsed": false
686 "collapsed": false
688 },
687 },
@@ -691,14 +690,14
691 "name": "stdout",
690 "name": "stdout",
692 "output_type": "stream",
691 "output_type": "stream",
693 "text": [
692 "text": [
694 "1000000 loops, best of 3: 888 ns per loop\n"
693 "100000 loops, best of 3: 2.78 µs per loop\n"
695 ]
694 ]
696 }
695 }
697 ],
696 ],
698 "source": [
697 "source": [
699 "%%timeit\n",
698 "%%timeit\n",
700 "range(10)\n",
699 "list(range(10))\n",
701 "range(100)"
700 "list(range(100))"
702 ]
701 ]
703 },
702 },
704 {
703 {
@@ -710,7 +709,7
710 },
709 },
711 {
710 {
712 "cell_type": "code",
711 "cell_type": "code",
713 "execution_count": 31,
712 "execution_count": 26,
714 "metadata": {
713 "metadata": {
715 "collapsed": false
714 "collapsed": false
716 },
715 },
@@ -719,20 +718,18
719 "name": "stdout",
718 "name": "stdout",
720 "output_type": "stream",
719 "output_type": "stream",
721 "text": [
720 "text": [
722 "size: 010000000 loops, best of 3: 129 ns per loop\n",
721 "size: 100 100000 loops, best of 3: 1.86 µs per loop\n",
723 " size: 1001000000 loops, best of 3: 649 ns per loop\n",
722 "size: 200 100000 loops, best of 3: 2.49 µs per loop\n",
724 " size: 2001000000 loops, best of 3: 1.09 µs per loop\n",
723 "size: 300 100000 loops, best of 3: 4.04 µs per loop\n",
725 " size: 3001000000 loops, best of 3: 1.74 µs per loop\n",
724 "size: 400 100000 loops, best of 3: 6.21 µs per loop\n"
726 " size: 400100000 loops, best of 3: 2.72 µs per loop\n",
727 "\n"
728 ]
725 ]
729 }
726 }
730 ],
727 ],
731 "source": [
728 "source": [
732 "for i in range(5):\n",
729 "for i in range(1, 5):\n",
733 " size = i*100\n",
730 " size = i*100\n",
734 " print 'size:',size, \n",
731 " print('size:', size, end=' ')\n",
735 " %timeit range(size)"
732 " %timeit list(range(size))"
736 ]
733 ]
737 },
734 },
738 {
735 {
@@ -744,7 +741,7
744 },
741 },
745 {
742 {
746 "cell_type": "code",
743 "cell_type": "code",
747 "execution_count": 32,
744 "execution_count": 27,
748 "metadata": {
745 "metadata": {
749 "collapsed": false
746 "collapsed": false
750 },
747 },
@@ -753,20 +750,21
753 "name": "stdout",
750 "name": "stdout",
754 "output_type": "stream",
751 "output_type": "stream",
755 "text": [
752 "text": [
756 "My shell is: /bin/bash\n",
753 "My shell is: /usr/local/bin/bash\n",
757 "My memory status is:\n",
754 "My disk usage is:\n",
758 " total used free shared buffers cached\n",
755 "Filesystem Size Used Avail Capacity iused ifree %iused Mounted on\n",
759 "Mem: 7870888 6389328 1481560 0 662860 2505172\n",
756 "/dev/disk1 233Gi 216Gi 16Gi 94% 56788108 4190706 93% /\n",
760 "-/+ buffers/cache: 3221296 4649592\n",
757 "devfs 190Ki 190Ki 0Bi 100% 656 0 100% /dev\n",
761 "Swap: 3905532 4852 3900680\n"
758 "map -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net\n",
759 "map auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home\n"
762 ]
760 ]
763 }
761 }
764 ],
762 ],
765 "source": [
763 "source": [
766 "%%bash\n",
764 "%%bash\n",
767 "echo \"My shell is:\" $SHELL\n",
765 "echo \"My shell is:\" $SHELL\n",
768 "echo \"My memory status is:\"\n",
766 "echo \"My disk usage is:\"\n",
769 "free"
767 "df -h"
770 ]
768 ]
771 },
769 },
772 {
770 {
@@ -778,7 +776,7
778 },
776 },
779 {
777 {
780 "cell_type": "code",
778 "cell_type": "code",
781 "execution_count": 33,
779 "execution_count": 28,
782 "metadata": {
780 "metadata": {
783 "collapsed": false
781 "collapsed": false
784 },
782 },
@@ -787,7 +785,7
787 "name": "stdout",
785 "name": "stdout",
788 "output_type": "stream",
786 "output_type": "stream",
789 "text": [
787 "text": [
790 "Writing test.txt\n"
788 "Overwriting test.txt\n"
791 ]
789 ]
792 }
790 }
793 ],
791 ],
@@ -801,7 +799,7
801 },
799 },
802 {
800 {
803 "cell_type": "code",
801 "cell_type": "code",
804 "execution_count": 34,
802 "execution_count": 29,
805 "metadata": {
803 "metadata": {
806 "collapsed": false
804 "collapsed": false
807 },
805 },
@@ -830,7 +828,7
830 },
828 },
831 {
829 {
832 "cell_type": "code",
830 "cell_type": "code",
833 "execution_count": 35,
831 "execution_count": 30,
834 "metadata": {
832 "metadata": {
835 "collapsed": false
833 "collapsed": false
836 },
834 },
@@ -874,21 +872,15
874 "bookmark": "OSMagics",
872 "bookmark": "OSMagics",
875 "cat": "Other",
873 "cat": "Other",
876 "cd": "OSMagics",
874 "cd": "OSMagics",
877 "cl": "Other",
878 "clear": "KernelMagics",
875 "clear": "KernelMagics",
879 "clk": "Other",
880 "colors": "BasicMagics",
876 "colors": "BasicMagics",
881 "config": "ConfigMagics",
877 "config": "ConfigMagics",
882 "connect_info": "KernelMagics",
878 "connect_info": "KernelMagics",
883 "cp": "Other",
879 "cp": "Other",
884 "d": "Other",
885 "dd": "Other",
886 "debug": "ExecutionMagics",
880 "debug": "ExecutionMagics",
887 "dhist": "OSMagics",
881 "dhist": "OSMagics",
888 "dirs": "OSMagics",
882 "dirs": "OSMagics",
889 "dl": "Other",
883 "doctest_mode": "BasicMagics",
890 "doctest_mode": "KernelMagics",
891 "dx": "Other",
892 "ed": "Other",
884 "ed": "Other",
893 "edit": "KernelMagics",
885 "edit": "KernelMagics",
894 "env": "OSMagics",
886 "env": "OSMagics",
@@ -922,6 +914,7
922 "mkdir": "Other",
914 "mkdir": "Other",
923 "more": "KernelMagics",
915 "more": "KernelMagics",
924 "mv": "Other",
916 "mv": "Other",
917 "namespace": "Other",
925 "notebook": "BasicMagics",
918 "notebook": "BasicMagics",
926 "page": "BasicMagics",
919 "page": "BasicMagics",
927 "pastebin": "CodeMagics",
920 "pastebin": "CodeMagics",
@@ -956,12 +949,15
956 "run": "ExecutionMagics",
949 "run": "ExecutionMagics",
957 "save": "CodeMagics",
950 "save": "CodeMagics",
958 "sc": "OSMagics",
951 "sc": "OSMagics",
952 "set_env": "OSMagics",
959 "store": "StoreMagics",
953 "store": "StoreMagics",
960 "sx": "OSMagics",
954 "sx": "OSMagics",
961 "system": "OSMagics",
955 "system": "OSMagics",
962 "tb": "ExecutionMagics",
956 "tb": "ExecutionMagics",
957 "tic": "TimerMagics",
963 "time": "ExecutionMagics",
958 "time": "ExecutionMagics",
964 "timeit": "ExecutionMagics",
959 "timeit": "ExecutionMagics",
960 "toc": "TimerMagics",
965 "unalias": "OSMagics",
961 "unalias": "OSMagics",
966 "unload_ext": "ExtensionMagics",
962 "unload_ext": "ExtensionMagics",
967 "who": "NamespaceMagics",
963 "who": "NamespaceMagics",
@@ -973,7 +969,7
973 },
969 },
974 "text/plain": [
970 "text/plain": [
975 "Available line magics:\n",
971 "Available line magics:\n",
976 "%alias %alias_magic %autocall %automagic %autosave %bookmark %cat %cd %cl %clear %clk %colors %config %connect_info %cp %d %dd %debug %dhist %dirs %dl %doctest_mode %dx %ed %edit %env %gui %hist %history %install_default_config %install_ext %install_profiles %killbgscripts %ldir %less %lf %lk %ll %load %load_ext %loadpy %logoff %logon %logstart %logstate %logstop %ls %lsmagic %lx %macro %magic %man %matplotlib %mkdir %more %mv %notebook %page %pastebin %pdb %pdef %pdoc %pfile %pinfo %pinfo2 %popd %pprint %precision %profile %prun %psearch %psource %pushd %pwd %pycat %pylab %qtconsole %quickref %recall %rehashx %reload_ext %rep %rerun %reset %reset_selective %rm %rmdir %run %save %sc %store %sx %system %tb %time %timeit %unalias %unload_ext %who %who_ls %whos %xdel %xmode\n",
972 "%alias %alias_magic %autocall %automagic %autosave %bookmark %cat %cd %clear %colors %config %connect_info %cp %debug %dhist %dirs %doctest_mode %ed %edit %env %gui %hist %history %install_default_config %install_ext %install_profiles %killbgscripts %ldir %less %lf %lk %ll %load %load_ext %loadpy %logoff %logon %logstart %logstate %logstop %ls %lsmagic %lx %macro %magic %man %matplotlib %mkdir %more %mv %namespace %notebook %page %pastebin %pdb %pdef %pdoc %pfile %pinfo %pinfo2 %popd %pprint %precision %profile %prun %psearch %psource %pushd %pwd %pycat %pylab %qtconsole %quickref %recall %rehashx %reload_ext %rep %rerun %reset %reset_selective %rm %rmdir %run %save %sc %set_env %store %sx %system %tb %tic %time %timeit %toc %unalias %unload_ext %who %who_ls %whos %xdel %xmode\n",
977 "\n",
973 "\n",
978 "Available cell magics:\n",
974 "Available cell magics:\n",
979 "%%! %%HTML %%SVG %%bash %%capture %%debug %%file %%html %%javascript %%latex %%perl %%prun %%pypy %%python %%python2 %%python3 %%ruby %%script %%sh %%svg %%sx %%system %%time %%timeit %%writefile\n",
975 "%%! %%HTML %%SVG %%bash %%capture %%debug %%file %%html %%javascript %%latex %%perl %%prun %%pypy %%python %%python2 %%python3 %%ruby %%script %%sh %%svg %%sx %%system %%time %%timeit %%writefile\n",
@@ -981,7 +977,7
981 "Automagic is ON, % prefix IS NOT needed for line magics."
977 "Automagic is ON, % prefix IS NOT needed for line magics."
982 ]
978 ]
983 },
979 },
984 "execution_count": 35,
980 "execution_count": 30,
985 "metadata": {},
981 "metadata": {},
986 "output_type": "execute_result"
982 "output_type": "execute_result"
987 }
983 }
@@ -1006,7 +1002,7
1006 },
1002 },
1007 {
1003 {
1008 "cell_type": "code",
1004 "cell_type": "code",
1009 "execution_count": 36,
1005 "execution_count": 31,
1010 "metadata": {
1006 "metadata": {
1011 "collapsed": false
1007 "collapsed": false
1012 },
1008 },
@@ -1029,13 +1025,13
1029 "... # the sum of two elements defines the next\n",
1025 "... # the sum of two elements defines the next\n",
1030 "... a, b = 0, 1\n",
1026 "... a, b = 0, 1\n",
1031 ">>> while b < 10:\n",
1027 ">>> while b < 10:\n",
1032 "... print b\n",
1028 "... print(b)\n",
1033 "... a, b = b, a+b"
1029 "... a, b = b, a+b"
1034 ]
1030 ]
1035 },
1031 },
1036 {
1032 {
1037 "cell_type": "code",
1033 "cell_type": "code",
1038 "execution_count": 37,
1034 "execution_count": 32,
1039 "metadata": {
1035 "metadata": {
1040 "collapsed": false
1036 "collapsed": false
1041 },
1037 },
@@ -1044,13 +1040,13
1044 "name": "stdout",
1040 "name": "stdout",
1045 "output_type": "stream",
1041 "output_type": "stream",
1046 "text": [
1042 "text": [
1047 "0 1 2 3 4 5 6 7 8 9\n"
1043 "0 1 2 3 4 5 6 7 8 9 "
1048 ]
1044 ]
1049 }
1045 }
1050 ],
1046 ],
1051 "source": [
1047 "source": [
1052 "In [1]: for i in range(10):\n",
1048 "In [1]: for i in range(10):\n",
1053 " ...: print i,\n",
1049 " ...: print(i, end=' ')\n",
1054 " ...: "
1050 " ...: "
1055 ]
1051 ]
1056 },
1052 },
@@ -1063,7 +1059,7
1063 },
1059 },
1064 {
1060 {
1065 "cell_type": "code",
1061 "cell_type": "code",
1066 "execution_count": 38,
1062 "execution_count": 33,
1067 "metadata": {
1063 "metadata": {
1068 "collapsed": false
1064 "collapsed": false
1069 },
1065 },
@@ -1072,7 +1068,7
1072 "name": "stdout",
1068 "name": "stdout",
1073 "output_type": "stream",
1069 "output_type": "stream",
1074 "text": [
1070 "text": [
1075 "Writing mod.py\n"
1071 "Overwriting mod.py\n"
1076 ]
1072 ]
1077 }
1073 }
1078 ],
1074 ],
@@ -1095,7 +1091,7
1095 },
1091 },
1096 {
1092 {
1097 "cell_type": "code",
1093 "cell_type": "code",
1098 "execution_count": 39,
1094 "execution_count": 34,
1099 "metadata": {
1095 "metadata": {
1100 "collapsed": false
1096 "collapsed": false
1101 },
1097 },
@@ -1105,10 +1101,11
1105 "evalue": "float division by zero",
1101 "evalue": "float division by zero",
1106 "output_type": "error",
1102 "output_type": "error",
1107 "traceback": [
1103 "traceback": [
1108 "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
1104 "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
1109 "\u001b[1;32m<ipython-input-39-a54c5799f57e>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mmod\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mmod\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mg\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
1105 "\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
1110 "\u001b[1;32m/home/fperez/ipython/tutorial/notebooks/mod.py\u001b[0m in \u001b[0;36mg\u001b[1;34m(y)\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mg\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0my\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 6\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mf\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0my\u001b[0m\u001b[1;33m+\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",