Skip to content

Instantly share code, notes, and snippets.

@fernandoacorreia
Created October 8, 2014 16:20
Show Gist options
  • Save fernandoacorreia/cd89156fa7d4365b856b to your computer and use it in GitHub Desktop.
Save fernandoacorreia/cd89156fa7d4365b856b to your computer and use it in GitHub Desktop.
sample IPython notebook
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"name": "",
"signature": "sha256:c2d84a66806f6beea772558684e5e08ccc7cbe9db661095043022d5db7c48cb4"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"from time import gmtime, strftime\n",
"current = strftime(\"%Y-%m-%d %H:%M:%S\", gmtime())\n",
"print 'The current time is', current"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The current time is 2014-10-08 16:18:41\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import random\n",
"\n",
"a = random.randint(1, 100)\n",
"b = random.randint(1, 100)\n",
"print 'a is', a\n",
"print 'b is', b"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"a is 28\n",
"b is 77\n"
]
}
],
"prompt_number": 2
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment