diff --git a/examples/notebooks/Animations Using clear_output.ipynb b/examples/notebooks/Animations Using clear_output.ipynb index fad886c..ef925b3 100644 --- a/examples/notebooks/Animations Using clear_output.ipynb +++ b/examples/notebooks/Animations Using clear_output.ipynb @@ -59,7 +59,7 @@ "for i in range(10):\n", " time.sleep(0.25)\n", " clear_output()\n", - " print i\n", + " print(i)\n", " sys.stdout.flush()" ], "language": "python", diff --git a/examples/notebooks/Cell Magics.ipynb b/examples/notebooks/Cell Magics.ipynb index 1fc2f43..a27475a 100644 --- a/examples/notebooks/Cell Magics.ipynb +++ b/examples/notebooks/Cell Magics.ipynb @@ -151,9 +151,10 @@ "collapsed": false, "input": [ "%%capture capt\n", + "from __future__ import print_function\n", "import sys\n", - "print 'Hello stdout'\n", - "print >> sys.stderr, 'and stderr'" + "print('Hello stdout')\n", + "print('and stderr', file=sys.stderr)" ], "language": "python", "metadata": {}, @@ -217,7 +218,7 @@ "collapsed": false, "input": [ "%%file foo.py\n", - "print 'Hello world'" + "print('Hello world')" ], "language": "python", "metadata": {}, @@ -471,8 +472,8 @@ "cell_type": "code", "collapsed": false, "input": [ - "print error\n", - "print output" + "print(error)\n", + "print(output)" ], "language": "python", "metadata": {}, @@ -563,7 +564,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "print ruby_lines.read()" + "print(ruby_lines.read())" ], "language": "python", "metadata": {}, @@ -927,7 +928,7 @@ "input": [ "b = %R a=resid(lm(Y~X))\n", "%Rpull a\n", - "print a\n", + "print(a)\n", "assert id(b.data) == id(a.data)\n", "%R -o a" ], @@ -963,10 +964,11 @@ "cell_type": "code", "collapsed": false, "input": [ + "from __future__ import print_function\n", "v1 = %R plot(X,Y); print(summary(lm(Y~X))); vv=mean(X)*mean(Y)\n", - "print 'v1 is:', v1\n", + "print('v1 is:', v1)\n", "v2 = %R mean(X)*mean(Y)\n", - "print 'v2 is:', v2" + "print('v2 is:', v2)" ], "language": "python", "metadata": {},