Skip to content

Instantly share code, notes, and snippets.

@gkhays
Last active March 15, 2017 22:27
Show Gist options
  • Save gkhays/ab584fc4a294acf9f742abf2bd7518f3 to your computer and use it in GitHub Desktop.
Save gkhays/ab584fc4a294acf9f742abf2bd7518f3 to your computer and use it in GitHub Desktop.
Run Jupyter Notebook Cells in VSCode
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"# Run Python and Jupyter within VSCode\n",
"\n",
"## Python\n",
"\n",
"Access the command palette with '`CTRL+Shift+P`' and then input '`t`' to move to the task runner.\n",
"\n",
"![Python Task Runner](https://gist.githubusercontent.com/gkhays/ab584fc4a294acf9f742abf2bd7518f3/raw/8df2194d3b6c713dfef92fbf313ced03b0865fd3/python_task_runner.png)\n",
"\n",
"This will launch tasks.json, which will be save locally in the `.vscode` folder relative to your project.\n",
"\n",
"![Tasks.json](https://gist.githubusercontent.com/gkhays/ab584fc4a294acf9f742abf2bd7518f3/raw/0f1ae60c70d07899a830d74dcb5e10a3d3b355f3/python_json.png)\n",
"\n",
"```json\n",
"{\n",
" \"version\": \"0.1.0\",\n",
" \"command\": \"python\",\n",
" \"isShellCommand\": true,\n",
" \"args\": [\"${file}\"],\n",
" \"showOutput\": \"always\"\n",
"}\n",
"```\n",
"\n",
"## Jupyter Notebook\n",
"\n",
"![Jupyter Commands](https://gist.githubusercontent.com/gkhays/ab584fc4a294acf9f742abf2bd7518f3/raw/e2ea5a346c58290d13291220cb852987a4bde084/vscode_jupyter_commands.png)\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment