Insert variable into text search string

Chris Angelico rosuav at
Thu Feb 20 03:06:21 CET 2014

On Thu, Feb 20, 2014 at 7:15 AM, Kevin Glover <kevingloveruk at> wrote:
> Thank you both so much. I had tried % but not successfully.

To do it with %, just do this:

whatever = "cat"
results ="\"of the %s's\""%whatever, type=ALL, start=1, count=1)

Use either that or .format(), whichever you like - both are fully
supported, and they have different strengths.


More information about the Python-list mailing list