I think these two pretty much do what you want.
execute_string(str,arg0,arg1,...) Execute the piece of code in the string str with the indicated arguments.
execute_file(fname,arg0,arg1,...) Execute the piece of code in the file with the indicated arguments.