Skip to content

Instantly share code, notes, and snippets.

@wgong
Created November 28, 2012 13:46
Show Gist options
  • Save wgong/4161421 to your computer and use it in GitHub Desktop.
Save wgong/4161421 to your computer and use it in GitHub Desktop.
IPython-Notebook-HelloWorld
{
"metadata": {
"name": "HelloWorld"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Welcome to IPython Notebook"
]
},
{
"cell_type": "raw",
"metadata": {},
"source": [
"IPy Notebook is a next-gen browser that offers interactivity and exploration"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here is an example: [What is Time?](http://nbviewer.ipython.org/4138271/)"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# define a string\n",
"a = \"IPython\"\n",
"a"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "pyout",
"prompt_number": 12,
"text": [
"'IPython'"
]
}
],
"prompt_number": 12
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# define a function\n",
"def hello(s):\n",
" print \"Hello \" + s"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 13
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# call the function\n",
"hello(a)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Hello IPython\n"
]
}
],
"prompt_number": 14
},
{
"cell_type": "heading",
"level": 5,
"metadata": {},
"source": [
"Find out more"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b>Step 1</b>: Visit [IPython Notebook](http://ipython.org/ipython-doc/stable/interactive/htmlnotebook.html)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b>Step 2</b>: Watch an 1 hour long video - [IPython Notebook](http://vimeo.com/53051817)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b>Step 3</b>: Watch a 3 hour long video - [IPython in-depth: high-productivity interactive and parallel python](https://www.youtube.com/watch?v=2G5YTlheCbw&feature=youtube_gdata_player)"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from IPython.display import YouTubeVideo"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 8
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"YouTubeVideo('2G5YTlheCbw')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"\n",
" <iframe\n",
" width=\"400\"\n",
" height=\"300\"\n",
" src=\"http://www.youtube.com/embed/2G5YTlheCbw\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" ></iframe>\n",
" "
],
"output_type": "pyout",
"prompt_number": 7,
"text": [
"<IPython.lib.display.YouTubeVideo at 0x449bab0>"
]
}
],
"prompt_number": 7
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment