From 69b25da8f2a13aa4a374ebb707a5cc420df908da Mon Sep 17 00:00:00 2001 From: Marci Date: Tue, 24 Nov 2015 17:06:08 -0800 Subject: [PATCH] gui 1 --- .../Interact-checkpoint.ipynb | 95 +++++++++++++++++++ GUI/Interact.ipynb | 95 +++++++++++++++++++ 2 files changed, 190 insertions(+) create mode 100644 GUI/.ipynb_checkpoints/Interact-checkpoint.ipynb create mode 100644 GUI/Interact.ipynb diff --git a/GUI/.ipynb_checkpoints/Interact-checkpoint.ipynb b/GUI/.ipynb_checkpoints/Interact-checkpoint.ipynb new file mode 100644 index 0000000..e5b1a1c --- /dev/null +++ b/GUI/.ipynb_checkpoints/Interact-checkpoint.ipynb @@ -0,0 +1,95 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Interact\n", + "\n", + "Let's get started with widgets in the Jupyter Notebook! We'll start with **interact**. **interact** is able to *auto-generate* UI controls for function arguments, and then calls the function with those arguments." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from ipywidgets import interact, interactive, fixed\n", + "import ipywidgets as widgets" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Basics" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def f(x):\n", + " return x" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "6" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "interact(f,x=10)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/GUI/Interact.ipynb b/GUI/Interact.ipynb new file mode 100644 index 0000000..e5b1a1c --- /dev/null +++ b/GUI/Interact.ipynb @@ -0,0 +1,95 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Interact\n", + "\n", + "Let's get started with widgets in the Jupyter Notebook! We'll start with **interact**. **interact** is able to *auto-generate* UI controls for function arguments, and then calls the function with those arguments." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from ipywidgets import interact, interactive, fixed\n", + "import ipywidgets as widgets" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Basics" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def f(x):\n", + " return x" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "6" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "interact(f,x=10)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +}