Name

execfile

Synopsis

void interp.execfile(String name)
void interp.execfile(java.io.InputStream s)
void interp.execfile(java.io.InputStream s,String name)

Executes, in interp’s namespace, the Python statements read from the stream s or from the file named name. When you pass both s and name, execfile reads the statements from s, and uses name as the filename in error messages.

Get Python in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.