default.json 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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": "code",
  54. "execution_count": 2,
  55. "metadata": {
  56. "tags": []
  57. },
  58. "outputs": [
  59. {
  60. "ename": "SyntaxError",
  61. "evalue": "invalid syntax (<ipython-input-2-6c5185427360>, line 1)",
  62. "output_type": "error",
  63. "traceback": [
  64. "\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"
  65. ]
  66. }
  67. ],
  68. "source": ["this is a syntax error"]
  69. },
  70. {
  71. "cell_type": "code",
  72. "execution_count": null,
  73. "metadata": {
  74. "tags": []
  75. },
  76. "outputs": [],
  77. "source": ["print('test')"]
  78. },
  79. {
  80. "cell_type": "code",
  81. "execution_count": 4,
  82. "metadata": {
  83. "tags": []
  84. },
  85. "outputs": [
  86. {
  87. "data": {
  88. "text/latex": [
  89. "The mass-energy equivalence is described by the famous equation\n",
  90. " \n",
  91. "$$E=mc^2$$\n",
  92. " \n",
  93. "discovered in 1905 by Albert Einstein. \n",
  94. "In natural units ($c$ = 1), the formula expresses the identity\n",
  95. " \n",
  96. "\\begin{equation}\n",
  97. "E=m\n",
  98. "\\end{equation}"
  99. ],
  100. "text/plain": ["<IPython.core.display.Latex object>"]
  101. },
  102. "execution_count": 4,
  103. "metadata": {},
  104. "output_type": "execute_result"
  105. }
  106. ],
  107. "source": [
  108. "from IPython.display import Latex\n",
  109. "Latex('''The mass-energy equivalence is described by the famous equation\n",
  110. " \n",
  111. "$$E=mc^2$$\n",
  112. " \n",
  113. "discovered in 1905 by Albert Einstein. \n",
  114. "In natural units ($c$ = 1), the formula expresses the identity\n",
  115. " \n",
  116. "\\\\begin{equation}\n",
  117. "E=m\n",
  118. "\\\\end{equation}''')"
  119. ]
  120. },
  121. {
  122. "cell_type": "code",
  123. "execution_count": null,
  124. "metadata": {
  125. "collapsed": true
  126. },
  127. "outputs": [],
  128. "source": []
  129. }
  130. ],
  131. "metadata": {
  132. "anaconda-cloud": {},
  133. "kernelspec": {
  134. "display_name": "Python [default]",
  135. "language": "python",
  136. "name": "python3"
  137. },
  138. "language_info": {
  139. "codemirror_mode": {
  140. "name": "ipython",
  141. "version": 3
  142. },
  143. "file_extension": ".py",
  144. "mimetype": "text/x-python",
  145. "name": "python",
  146. "nbconvert_exporter": "python",
  147. "pygments_lexer": "ipython3",
  148. "version": "3.5.2"
  149. }
  150. },
  151. "nbformat": 4,
  152. "nbformat_minor": 1
  153. }