Skip to content

Instantly share code, notes, and snippets.

@jdfreder
Created August 8, 2013 03:58
Show Gist options
  • Save jdfreder/6181325 to your computer and use it in GitHub Desktop.
Save jdfreder/6181325 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"print(\"this\\nwill%\\nruin everything!\")"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"this\n",
"will%\n",
"ruin everything!\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from IPython.nbformat import current\n",
"with open('Untitled0.ipynb') as f:\n",
" nb = current.read(f,'json')\n",
"nb.worksheets[0].cells[0]"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 2,
"text": [
"{u'cell_type': u'code',\n",
" u'collapsed': False,\n",
" u'input': u'print(\"this\\\\nwill%\\\\nruin everything!\")',\n",
" u'language': u'python',\n",
" u'metadata': {},\n",
" u'outputs': [{u'output_type': u'stream',\n",
" u'stream': u'stdout',\n",
" u'text': u'this\\nwill%\\nruin everything!\\n'}],\n",
" u'prompt_number': 1}"
]
}
],
"prompt_number": 2
},
{
"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