Created
May 15, 2014 21:29
-
-
Save jbarratt/0b30daa0cdc001412b7c to your computer and use it in GitHub Desktop.
Slow Process Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:ccedbbb6aa094c1eb25e73e3c9012e05ed4792c69e3d6d91bbceba0ee9e34729" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"import time\n", | |
"from IPython.display import clear_output\n", | |
"from ipy_table import make_table\n", | |
"import sys\n", | |
"\n", | |
"data = [['numbers']]\n", | |
"\n", | |
"for i in range(10):\n", | |
" clear_output()\n", | |
" print \"Currently working on {}\".format(i)\n", | |
" sys.stdout.flush()\n", | |
" time.sleep(1)\n", | |
" data.append([i])\n", | |
"\n", | |
"make_table(data)" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
"Currently working on 9\n" | |
] | |
}, | |
{ | |
"html": [ | |
"<table border=\"1\" cellpadding=\"3\" cellspacing=\"0\" style=\"border:1px solid black;border-collapse:collapse;\"><tr><td>numbers</td></tr><tr><td>0</td></tr><tr><td>1</td></tr><tr><td>2</td></tr><tr><td>3</td></tr><tr><td>4</td></tr><tr><td>5</td></tr><tr><td>6</td></tr><tr><td>7</td></tr><tr><td>8</td></tr><tr><td>9</td></tr></table>" | |
], | |
"metadata": {}, | |
"output_type": "pyout", | |
"prompt_number": 1, | |
"text": [ | |
"<ipy_table.IpyTable at 0x10915ad90>" | |
] | |
} | |
], | |
"prompt_number": 1 | |
} | |
], | |
"metadata": {} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment