UNPKG

5.34 kBJSONView Raw
1{
2 "cells": [
3 {
4 "cell_type": "code",
5 "execution_count": 1,
6 "metadata": {
7 "tags": []
8 },
9 "outputs": [
10 {
11 "name": "stdout",
12 "output_type": "stream",
13 "text": ["hello world\n", "0\n", "1\n", "2\n"]
14 },
15 {
16 "name": "stderr",
17 "output_type": "stream",
18 "text": ["output to stderr\n"]
19 },
20 {
21 "name": "stdout",
22 "output_type": "stream",
23 "text": ["some more stdout text\n"]
24 }
25 ],
26 "source": [
27 "import sys\n",
28 "sys.stdout.write('hello world\\n')\n",
29 "sys.stdout.flush()\n",
30 "for i in range(3):\n",
31 " sys.stdout.write('%s\\n' % i)\n",
32 " sys.stdout.flush()\n",
33 "sys.stderr.write('output to stderr\\n')\n",
34 "sys.stderr.flush()\n",
35 "sys.stdout.write('some more stdout text\\n')\n",
36 "sys.stdout.flush()"
37 ]
38 },
39 {
40 "cell_type": "markdown",
41 "metadata": {
42 "tags": []
43 },
44 "source": [
45 "# Markdown Cell\n",
46 "\n",
47 "$ e^{ \\pm i\\theta } = \\cos \\theta \\pm i\\sin \\theta + \\beta $\n",
48 "\n",
49 "*It* **really** is!"
50 ]
51 },
52 {
53 "cell_type": "raw",
54 "metadata": {
55 "tags": []
56 },
57 "source": ["Raw Cell\n", "\n", "Second line"]
58 },
59 {
60 "cell_type": "code",
61 "execution_count": 2,
62 "metadata": {
63 "tags": []
64 },
65 "outputs": [
66 {
67 "ename": "SyntaxError",
68 "evalue": "invalid syntax (<ipython-input-2-6c5185427360>, line 1)",
69 "output_type": "error",
70 "traceback": [
71 "\u001b[0;36m File \u001b[0;32m\"<ipython-input-2-6c5185427360>\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m this is a syntax error\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
72 ]
73 }
74 ],
75 "source": ["this is a syntax error"]
76 },
77 {
78 "cell_type": "code",
79 "execution_count": null,
80 "metadata": {
81 "tags": []
82 },
83 "outputs": [],
84 "source": ["print('test')"]
85 },
86 {
87 "cell_type": "code",
88 "execution_count": 4,
89 "metadata": {
90 "tags": []
91 },
92 "outputs": [
93 {
94 "data": {
95 "text/latex": [
96 "The mass-energy equivalence is described by the famous equation\n",
97 " \n",
98 "$$E=mc^2$$\n",
99 " \n",
100 "discovered in 1905 by Albert Einstein. \n",
101 "In natural units ($c$ = 1), the formula expresses the identity\n",
102 " \n",
103 "\\begin{equation}\n",
104 "E=m\n",
105 "\\end{equation}"
106 ],
107 "text/plain": ["<IPython.core.display.Latex object>"]
108 },
109 "execution_count": 4,
110 "metadata": {},
111 "output_type": "execute_result"
112 }
113 ],
114 "source": [
115 "from IPython.display import Latex\n",
116 "Latex('''The mass-energy equivalence is described by the famous equation\n",
117 " \n",
118 "$$E=mc^2$$\n",
119 " \n",
120 "discovered in 1905 by Albert Einstein. \n",
121 "In natural units ($c$ = 1), the formula expresses the identity\n",
122 " \n",
123 "\\\\begin{equation}\n",
124 "E=m\n",
125 "\\\\end{equation}''')"
126 ]
127 },
128 {
129 "cell_type": "code",
130 "execution_count": null,
131 "metadata": {
132 "collapsed": true
133 },
134 "outputs": [],
135 "source": []
136 }
137 ],
138 "metadata": {
139 "anaconda-cloud": {},
140 "kernelspec": {
141 "display_name": "Python [default]",
142 "language": "python",
143 "name": "python3"
144 },
145 "language_info": {
146 "codemirror_mode": {
147 "name": "ipython",
148 "version": 3
149 },
150 "file_extension": ".py",
151 "mimetype": "text/x-python",
152 "name": "python",
153 "nbconvert_exporter": "python",
154 "pygments_lexer": "ipython3",
155 "version": "3.5.2"
156 }
157 },
158 "nbformat": 4,
159 "nbformat_minor": 1
160}