Advertisement
pleabargain

getting ipython to load videos at specific time

Jul 23rd, 2013
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.11 KB | None | 0 0
  1. {
  2.  "metadata": {
  3.   "name": ""
  4.  },
  5.  "nbformat": 3,
  6.  "nbformat_minor": 0,
  7.  "worksheets": [
  8.   {
  9.    "cells": [
  10.     {
  11.      "cell_type": "code",
  12.      "collapsed": false,
  13.      "input": [
  14.       "from IPython.display import YouTubeVideo\n",
  15.       "# Khan Academy on lists\n",
  16.       "YouTubeVideo('zEyEC34MY1A#t=1m23s') \n",
  17.       "#? does not work with time code\n",
  18.       "#don't use ? use #t"
  19.      ],
  20.      "language": "python",
  21.      "metadata": {},
  22.      "outputs": [
  23.       {
  24.        "html": [
  25.         "\n",
  26.         "        <iframe\n",
  27.         "            width=\"400\"\n",
  28.         "            height=300\"\n",
  29.         "            src=\"http://www.youtube.com/embed/zEyEC34MY1A#t=1m23s\"\n",
  30.         "            frameborder=\"0\"\n",
  31.         "            allowfullscreen\n",
  32.         "        ></iframe>\n",
  33.         "        "
  34.        ],
  35.        "metadata": {},
  36.        "output_type": "pyout",
  37.        "prompt_number": 20,
  38.        "text": [
  39.         "<IPython.lib.display.YouTubeVideo at 0x4374f50>"
  40.        ]
  41.       }
  42.      ],
  43.      "prompt_number": 20
  44.     },
  45.     {
  46.      "cell_type": "code",
  47.      "collapsed": false,
  48.      "input": [
  49.       "from IPython.display import YouTubeVideo\n",
  50.       "# Khan Academy on lists\n",
  51.       "YouTubeVideo('zEyEC34MY1A') #does not work with time code"
  52.      ],
  53.      "language": "python",
  54.      "metadata": {},
  55.      "outputs": [
  56.       {
  57.        "html": [
  58.         "\n",
  59.         "        <iframe\n",
  60.         "            width=\"400\"\n",
  61.         "            height=300\"\n",
  62.         "            src=\"http://www.youtube.com/embed/zEyEC34MY1A\"\n",
  63.         "            frameborder=\"0\"\n",
  64.         "            allowfullscreen\n",
  65.         "        ></iframe>\n",
  66.         "        "
  67.        ],
  68.        "output_type": "pyout",
  69.        "prompt_number": 3,
  70.        "text": [
  71.         "<IPython.lib.display.YouTubeVideo at 0x442c650>"
  72.        ]
  73.       }
  74.      ],
  75.      "prompt_number": 3
  76.     },
  77.     {
  78.      "cell_type": "code",
  79.      "collapsed": false,
  80.      "input": [
  81.       "Ipython.diplay?"
  82.      ],
  83.      "language": "python",
  84.      "metadata": {},
  85.      "outputs": [
  86.       {
  87.        "output_type": "stream",
  88.        "stream": "stdout",
  89.        "text": [
  90.         "Object `Ipython.diplay` not found.\n"
  91.        ]
  92.       }
  93.      ],
  94.      "prompt_number": 3
  95.     },
  96.     {
  97.      "cell_type": "code",
  98.      "collapsed": false,
  99.      "input": [
  100.       "from IPython.display import YouTubeVideo\n"
  101.      ],
  102.      "language": "python",
  103.      "metadata": {},
  104.      "outputs": [],
  105.      "prompt_number": 10
  106.     },
  107.     {
  108.      "cell_type": "code",
  109.      "collapsed": false,
  110.      "input": [
  111.       "IPython.display?"
  112.      ],
  113.      "language": "python",
  114.      "metadata": {},
  115.      "outputs": [
  116.       {
  117.        "output_type": "stream",
  118.        "stream": "stdout",
  119.        "text": [
  120.         "Object `IPython.display` not found.\n"
  121.        ]
  122.       }
  123.      ],
  124.      "prompt_number": 11
  125.     },
  126.     {
  127.      "cell_type": "code",
  128.      "collapsed": false,
  129.      "input": [
  130.       "%history -l 10-11"
  131.      ],
  132.      "language": "python",
  133.      "metadata": {},
  134.      "outputs": [
  135.       {
  136.        "output_type": "stream",
  137.        "stream": "stderr",
  138.        "text": [
  139.         "UsageError: argument -l: invalid int value: '10-11'"
  140.        ]
  141.       }
  142.      ],
  143.      "prompt_number": 12
  144.     },
  145.     {
  146.      "cell_type": "code",
  147.      "collapsed": false,
  148.      "input": [
  149.       "%history?"
  150.      ],
  151.      "language": "python",
  152.      "metadata": {},
  153.      "outputs": [],
  154.      "prompt_number": 13
  155.     },
  156.     {
  157.      "cell_type": "code",
  158.      "collapsed": false,
  159.      "input": [
  160.       "%history -n 10-11 -o"
  161.      ],
  162.      "language": "python",
  163.      "metadata": {},
  164.      "outputs": [
  165.       {
  166.        "output_type": "stream",
  167.        "stream": "stdout",
  168.        "text": [
  169.         "  10: from IPython.display import YouTubeVideo\n",
  170.         "  11: IPython.display?\n"
  171.        ]
  172.       }
  173.      ],
  174.      "prompt_number": 19
  175.     },
  176.     {
  177.      "cell_type": "code",
  178.      "collapsed": false,
  179.      "input": [],
  180.      "language": "python",
  181.      "metadata": {},
  182.      "outputs": []
  183.     }
  184.    ],
  185.    "metadata": {}
  186.   }
  187.  ]
  188. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement