Skip to content

Instantly share code, notes, and snippets.

@snippsat
Created February 23, 2020 15:16
Show Gist options
  • Save snippsat/367c3d789875b96408f742915b79a7af to your computer and use it in GitHub Desktop.
Save snippsat/367c3d789875b96408f742915b79a7af to your computer and use it in GitHub Desktop.
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Untitled5.ipynb",
"provenance": [],
"collapsed_sections": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "code",
"metadata": {
"id": "MslJrbZNjnGZ",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 102
},
"outputId": "14456a6f-487f-44d8-c335-49559e4e63e2"
},
"source": [
"# test_read.py\n",
"import json\n",
"from pprint import pprint\n",
" \n",
"with open(\"data.json\", \"r\") as read_file:\n",
" data = json.load(read_file)\n",
" \n",
"pprint(data)"
],
"execution_count": 1,
"outputs": [
{
"output_type": "stream",
"text": [
"{'age': 35,\n",
" 'children': [{'age': 6, 'firstName': 'Alice'}, {'age': 8, 'firstName': 'Bob'}],\n",
" 'firstName': 'Jane',\n",
" 'hobbies': ['running', 'sky diving', 'singing'],\n",
" 'lastName': 'Doe'}\n"
],
"name": "stdout"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment