Please help, please answer

Hello! I’m new to programming, please help. How to check the balance of a private key bitcoin? Or get an address from it? Available 400 keys.
Sorry if not in that section wrote.


from pybitcoin import BitcoinPrivateKey
import requests
import json

FILE_PATH = r'C:\Users\user\Desktop\keys.txt'

with open(FILE_PATH) as f:
    keys =

for key in keys:
    private_key = BitcoinPrivateKey(private_key=key.)

public_key = private_key.public_key()
address = public_key.address()

r = requests.get('{}'.format(address))
print ('Address: {} Private Key: {} Balance: {}'.format(address, key, (json.loads(r.content)['data']['balance'])))

screen   script errors