I want to be able to use a placeholder in a string that already contains a %
symbol. For instance, I would like to be able to iterate to open multiple URLs by m
You can escape %
by doubling it:
>>> 'http://www.example.com/BLABLA%%123BLABLApage=%d' % (1,)
'http://www.example.com/BLABLA%123BLABLApage=1'
Alternatively, use str.format() formatting instead:
>>> 'http://www.example.com/BLABLA%123BLABLApage={:d}'.format(1)
'http://www.example.com/BLABLA%123BLABLApage=1'