{ "cells": [ { "cell_type": "code", "execution_count": 17, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import ipywidgets as widgets\n", "from IPython.display import display" ] }, { "cell_type": "code", "execution_count": 24, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import threading\n", "def input_thread(list):\n", " input()\n", " list.append(None)\n", "\n", "def do_stuff():\n", " list = []\n", " threading.Thread(target = input_thread, args = (list,))\n", " print (list)\n", " while not list:\n", " import time\n", " time.sleep(0.5)\n", " print ('stuff')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[]\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n", "stuff\n" ] } ], "source": [ "do_stuff()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python [conda root]", "language": "python", "name": "conda-root-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.2" } }, "nbformat": 4, "nbformat_minor": 2 }