Name
PyRun_File
Synopsis
PyObject* PyRun_File(FILE*fp
,char*filename
,intstart
, PyObject*globals
,PyObject*locals
)
fp
is a file of source code open for
reading. filename
is the name of the file,
to use in error messages. start
is one of
the constants that define execution mode.
globals
and
locals
are dictionaries (may be the same
dictionary twice) to use as global and local namespace for the
execution. Returns the result of the expression when
start
is Py_eval_input
,
a new reference to Py_None
otherwise, or
NULL
to indicate that an exception has been raised
(often, but not always, due to a syntax error).
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.