Easy "here documents" ??

Jim Hill jimhill at swcp.com
Sun Dec 19 03:37:15 CET 2004

I've done some Googling around on this and it seems like creating a here
document is a bit tricky with Python.  Trivial via triple-quoted strings
if there's no need for variable interpolation but requiring a long, long
formatted arglist via (%s,%s,%s,ad infinitum) if there is.  So my
question is:

Is there a way to produce a very long multiline string of output with
variables' values inserted without having to resort to this wacky

"""v = %s"""%(variable)



Jim, Python no0b
"I regard NASCAR the same way I regard gay porn: I know it exists and I
know some guys like it; I just don't want to see it."  --  Z. B. Goode

More information about the Python-list mailing list