Show More
@@ -59,7 +59,7 b'' | |||||
59 | "for i in range(10):\n", |
|
59 | "for i in range(10):\n", | |
60 | " time.sleep(0.25)\n", |
|
60 | " time.sleep(0.25)\n", | |
61 | " clear_output()\n", |
|
61 | " clear_output()\n", | |
62 |
" print |
|
62 | " print(i)\n", | |
63 | " sys.stdout.flush()" |
|
63 | " sys.stdout.flush()" | |
64 | ], |
|
64 | ], | |
65 | "language": "python", |
|
65 | "language": "python", |
@@ -151,9 +151,10 b'' | |||||
151 | "collapsed": false, |
|
151 | "collapsed": false, | |
152 | "input": [ |
|
152 | "input": [ | |
153 | "%%capture capt\n", |
|
153 | "%%capture capt\n", | |
|
154 | "from __future__ import print_function\n", | |||
154 | "import sys\n", |
|
155 | "import sys\n", | |
155 |
"print |
|
156 | "print('Hello stdout')\n", | |
156 | "print >> sys.stderr, 'and stderr'" |
|
157 | "print('and stderr', file=sys.stderr)" | |
157 | ], |
|
158 | ], | |
158 | "language": "python", |
|
159 | "language": "python", | |
159 | "metadata": {}, |
|
160 | "metadata": {}, | |
@@ -217,7 +218,7 b'' | |||||
217 | "collapsed": false, |
|
218 | "collapsed": false, | |
218 | "input": [ |
|
219 | "input": [ | |
219 | "%%file foo.py\n", |
|
220 | "%%file foo.py\n", | |
220 |
"print |
|
221 | "print('Hello world')" | |
221 | ], |
|
222 | ], | |
222 | "language": "python", |
|
223 | "language": "python", | |
223 | "metadata": {}, |
|
224 | "metadata": {}, | |
@@ -471,8 +472,8 b'' | |||||
471 | "cell_type": "code", |
|
472 | "cell_type": "code", | |
472 | "collapsed": false, |
|
473 | "collapsed": false, | |
473 | "input": [ |
|
474 | "input": [ | |
474 |
"print |
|
475 | "print(error)\n", | |
475 |
"print |
|
476 | "print(output)" | |
476 | ], |
|
477 | ], | |
477 | "language": "python", |
|
478 | "language": "python", | |
478 | "metadata": {}, |
|
479 | "metadata": {}, | |
@@ -563,7 +564,7 b'' | |||||
563 | "cell_type": "code", |
|
564 | "cell_type": "code", | |
564 | "collapsed": false, |
|
565 | "collapsed": false, | |
565 | "input": [ |
|
566 | "input": [ | |
566 |
"print |
|
567 | "print(ruby_lines.read())" | |
567 | ], |
|
568 | ], | |
568 | "language": "python", |
|
569 | "language": "python", | |
569 | "metadata": {}, |
|
570 | "metadata": {}, | |
@@ -927,7 +928,7 b'' | |||||
927 | "input": [ |
|
928 | "input": [ | |
928 | "b = %R a=resid(lm(Y~X))\n", |
|
929 | "b = %R a=resid(lm(Y~X))\n", | |
929 | "%Rpull a\n", |
|
930 | "%Rpull a\n", | |
930 |
"print |
|
931 | "print(a)\n", | |
931 | "assert id(b.data) == id(a.data)\n", |
|
932 | "assert id(b.data) == id(a.data)\n", | |
932 | "%R -o a" |
|
933 | "%R -o a" | |
933 | ], |
|
934 | ], | |
@@ -963,10 +964,11 b'' | |||||
963 | "cell_type": "code", |
|
964 | "cell_type": "code", | |
964 | "collapsed": false, |
|
965 | "collapsed": false, | |
965 | "input": [ |
|
966 | "input": [ | |
|
967 | "from __future__ import print_function\n", | |||
966 | "v1 = %R plot(X,Y); print(summary(lm(Y~X))); vv=mean(X)*mean(Y)\n", |
|
968 | "v1 = %R plot(X,Y); print(summary(lm(Y~X))); vv=mean(X)*mean(Y)\n", | |
967 |
"print |
|
969 | "print('v1 is:', v1)\n", | |
968 | "v2 = %R mean(X)*mean(Y)\n", |
|
970 | "v2 = %R mean(X)*mean(Y)\n", | |
969 |
"print |
|
971 | "print('v2 is:', v2)" | |
970 | ], |
|
972 | ], | |
971 | "language": "python", |
|
973 | "language": "python", | |
972 | "metadata": {}, |
|
974 | "metadata": {}, |
General Comments 0
You need to be logged in to leave comments.
Login now