Skip to content

Instantly share code, notes, and snippets.

@veretennikovalexey
Created July 1, 2022 16:34
Show Gist options
  • Save veretennikovalexey/e57875a98f98762733b49eac3700e9ff to your computer and use it in GitHub Desktop.
Save veretennikovalexey/e57875a98f98762733b49eac3700e9ff to your computer and use it in GitHub Desktop.
astronauts.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "astronauts.ipynb",
"provenance": [],
"authorship_tag": "ABX9TyNAUMnXCf9Fvxwz7M/E6Lij",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/veretennikovalexey/e57875a98f98762733b49eac3700e9ff/astronauts.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Nfwr4JoEldFM",
"outputId": "7ab7cd72-0b40-49ae-ed73-350cc8d0684f"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Oleg Artemyev\n",
"Denis Matveev\n",
"Sergey Korsakov\n",
"Kjell Lindgren\n",
"Bob Hines\n",
"Samantha Cristoforetti\n",
"Jessica Watkins\n",
"Cai Xuzhe\n",
"Chen Dong\n",
"Liu Yang\n"
]
}
],
"source": [
"import requests\n",
"import json\n",
"\n",
"astronauts = 'http://api.open-notify.org/astros.json'\n",
"rg = requests.get( astronauts )\n",
"js = rg.json()\n",
"people = js[ 'people' ]\n",
"# print( js[ 'people' ] )\n",
"for name in people :\n",
" print( name[ 'name' ] )"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment