import requests

def get_tor_session():
    session = requests.session()
    session.proxies = {'http':  'socks5://127.0.0.1:9050',
                       'https': 'socks5://127.0.0.1:9050'}
    return session

print("Zwykły publiczny adres IP:", requests.get("http://httpbin.org/ip").text)
session = get_tor_session()
print("Adres IP do połączenia z siecią Tor:", session.get("http://httpbin.org/ip").text)
response = session.get('https://www.facebookcorewwwi.onion/')
for key,value in response.headers.items():
    print(key,value)