you need to double the percent sign to avoid it:
>>> '%%%s%%' % 'PLAYER_ID' '%PLAYER_ID%'
Also, when iterating through a dictionary, you can unpack the values ββin the for statement as follows:
def __init__(self, url, **kwargs): for key, value in kwargs.items(): url = url.replace('%%%s%%' % key, str(value))
Silentghost
source share