In this case it was easier to convert it to apply rather than programming Python in %s formatted strings...