Following code:
def __init__(self, url, **kwargs):
for key in kwargs.keys():
url = url.replace('%%s%' % key, str(kwargs[key]))
Throws the following exception:
File "/home/wells/py-mlb/lib/fetcher.py", line 25, in __init__
url = url.replace('%%s%' % key, str(kwargs[key]))
ValueError: incomplete format
The string has a format like:
http://www.blah.com?id=%PLAYER_ID%
What am I doing wrong?