#!/usr/bin/env python3
import requests
from requests.auth import HTTPBasicAuth
from getpass import getpass

username = input("Podaj nazwę użytkownika: ")
password = getpass()
response = requests.get('https://api.github.com/user', 
                        auth = HTTPBasicAuth(username, password))
print('Kod stanu: ' + str(response.status_code))
if response.status_code == 200:
    print('Uwierzytelnienie pomyślne: ' + response.text)