Skip to content

Instantly share code, notes, and snippets.

@catherinedevlin
Created March 29, 2017 19:39
Show Gist options
  • Save catherinedevlin/047b453ef372557d1f943aec800e37e5 to your computer and use it in GitHub Desktop.
Save catherinedevlin/047b453ef372557d1f943aec800e37e5 to your computer and use it in GitHub Desktop.
Shell + ipython
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Shell-Python integration"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\r\n",
" \"indentation\": {\r\n",
" \"level\": \"error\",\r\n",
" \"value\": 2\r\n",
" },\r\n",
" \"line_endings\": {\r\n",
" \"value\": \"unix\",\r\n",
" \"level\": \"error\"\r\n",
" },\r\n",
" \"max_line_length\": {\r\n",
" \"value\": false\r\n",
" }\r\n",
"}"
]
}
],
"source": [
"cat ./.atom/packages/atom-beautify/coffeelint.json"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"x =! cat ./.atom/packages/atom-beautify/coffeelint.json"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"['{',\n",
" ' \"indentation\": {',\n",
" ' \"level\": \"error\",',\n",
" ' \"value\": 2',\n",
" ' },',\n",
" ' \"line_endings\": {',\n",
" ' \"value\": \"unix\",',\n",
" ' \"level\": \"error\"',\n",
" ' },',\n",
" ' \"max_line_length\": {',\n",
" ' \"value\": false',\n",
" ' }',\n",
" '}']"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{ \"indentation\": { \"level\": \"error\", \"value\": 2 }, \"line_endings\": { \"value\": \"unix\", \"level\": \"error\" }, \"max_line_length\": { \"value\": false } }\n"
]
}
],
"source": [
"print(x.s)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\n",
" \"indentation\": {\n",
" \"level\": \"error\",\n",
" \"value\": 2\n",
" },\n",
" \"line_endings\": {\n",
" \"value\": \"unix\",\n",
" \"level\": \"error\"\n",
" },\n",
" \"max_line_length\": {\n",
" \"value\": false\n",
" }\n",
"}\n"
]
}
],
"source": [
"print(x.n)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CHANGELOG.md\n",
"CONTRIBUTING.md\n",
"ISSUE_TEMPLATE.md\n",
"LICENSE.md\n",
"PULL_REQUEST_TEMPLATE.md\n",
"README-template.md\n",
"README.md\n",
"ROADMAP.md\n",
"appveyor\n",
"appveyor.yml\n",
"build-package.sh\n",
"coffeelint.json\n",
"docs\n",
"examples\n",
"keymaps\n",
"menus\n",
"node_modules\n",
"package.json\n",
"script\n",
"spec\n",
"src\n",
"styles\n"
]
}
],
"source": [
"%%bash\n",
"ls ./.atom/packages/atom-beautify"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment