i have a bunch of generated strings (read from a file) that are being processed in my script by str.format() with a bunch of args. today, i ran into a case where i have a '{' in one of the strings and str.format() is upset by it. the normal solution with str.format is '{'->'{{'. but this is turning out to be impossible to do because all the '{' are being doubled. what i can do, easily, is have the various '{}' and '{foo}' that are being added changed to something else like maybe '[]' and '[foo]' (i will need to grep this data a few times to see what i can safely pick).
is there a way to have str.format() use an alternate for '{}' and '{foo}'?
is there a way to have str.format() use an alternate for '{}' and '{foo}'?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.