Skip to content

Instantly share code, notes, and snippets.

View Kanhalelor's full-sized avatar

Robson Kanhalelor

View GitHub Profile
import requests
import json
<class 'str'>
{"number": 3, "people": [{"craft": "ISS", "name": "Chris Cassidy"}, {"craft": "ISS", "name": "Anatoly Ivanishin"}, {"craft": "ISS", "name": "Ivan Vagner"}], "message": "success"}
python3 astros.py
#200
data = response.text
# get the data type we received
print(type(data))
print(data)
import requests
# The open-notify API
url = "http://api.open-notify.org/astros.json"
response = requests.get(url)
status_code = response.status_code
print(status_code)
@Kanhalelor
Kanhalelor / astros.py
Created April 27, 2021 14:38
article gist
pip install requests
@Kanhalelor
Kanhalelor / calculator.py
Created September 24, 2020 06:24
Basic Calculator with python
# imports
import tkinter as tk
from tkinter import Label, Entry, Button
#create a window
WINDOW = tk.Tk()
WINDOW.title('Python GUI Calculator')
def add():
"""function to add two integers"""
num1 = int(entry1.get())