{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Python: As a very good scripting language\n", "Gonzalo Rios - grios@dim.uchile.cl\n", "\n", "https://docs.python.org/3/tutorial/index.html" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2018-09-25T19:26:24.466298Z", "start_time": "2018-09-25T19:26:24.463128Z" } }, "outputs": [], "source": [ "'hola'" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2018-09-25T19:26:26.351829Z", "start_time": "2018-09-25T19:26:26.348784Z" } }, "outputs": [], "source": [ "\"hola\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2018-09-25T19:26:31.337868Z", "start_time": "2018-09-25T19:26:31.334780Z" } }, "outputs": [], "source": [ "1 + 2" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2018-09-25T19:26:38.977722Z", "start_time": "2018-09-25T19:26:38.974296Z" } }, "outputs": [], "source": [ "1e9 * 1.0125 // 33.93 ** 2.2" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2018-09-25T19:26:52.661801Z", "start_time": "2018-09-25T19:26:52.659107Z" } }, "outputs": [], "source": [ "#Comment\n", "x = 'chao'\n", "print(x)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2018-09-25T19:27:14.171060Z", "start_time": "2018-09-25T19:27:14.167572Z" } }, "outputs": [], "source": [ "x" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2018-09-25T19:27:31.864405Z", "start_time": "2018-09-25T19:27:31.859415Z" } }, "outputs": [], "source": [ "help(help)\n", "print('\\n' + (('*' * 90) + '\\n') * 5)\n", "help(print)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2018-09-25T19:27:55.782208Z", "start_time": "2018-09-25T19:27:55.778751Z" } }, "outputs": [], "source": [ "p = print\n", "p" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Jupyter Notebook\n", "Markdown and $Latex$ support. Nbextensions. Templates." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Esta es una funcion cosntante: $f(x) = \\pi$" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2018-09-25T19:29:31.086111Z", "start_time": "2018-09-25T19:29:31.083053Z" } }, "outputs": [], "source": [ "p?" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2018-09-25T19:29:50.130861Z", "start_time": "2018-09-25T19:29:50.020660Z" } }, "outputs": [], "source": [ "!ls" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2018-09-25T19:30:11.507857Z", "start_time": "2018-09-25T19:30:11.491486Z" } }, "outputs": [], "source": [ "%lsmagic" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2018-09-25T19:30:30.346340Z", "start_time": "2018-09-25T19:30:30.336493Z" } }, "outputs": [], "source": [ "%%bash\n", "pwd\n", "ls\n", "cd ..\n", "echo\n", "pwd\n", "ls" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2018-09-25T19:30:47.506350Z", "start_time": "2018-09-25T19:30:47.500380Z" } }, "outputs": [], "source": [ "%%latex\n", "\\begin{align}\n", "a = \\frac{1}{2} && b = \\frac{1}{3} && c = \\frac{1}{4} \\\\\n", "a && b && c \\\\\n", "1 && 2 && 3\n", "\\end{align}" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2018-09-25T19:31:02.349349Z", "start_time": "2018-09-25T19:31:02.343519Z" } }, "outputs": [], "source": [ "%%HTML\n", "