I'd like to dynamically execute multiple lines of indented code from within a script, but I can't seem to find a suitable function. Exec only works with unindented code, and execfile only works with files. I suppose I could write my string to a temporary file and then use execfile, but that seems like a hack. Is there an easier way? Any help is appreciated.