Extending Embedded Python and execute external script
fredrik at pythonware.com
Thu Jan 4 14:02:59 CET 2007
"Vertilka" <vertilka at gmail.com> wrote:
> I saw several functions: PyRun_AnyFileExFlags, PyRun_SimpleFileExFlags,
> 1) Which one should i use in order to achieve what i need ?
PyRun_SimpleFile or PyRun_SimpleString should be good enough. Using
SimpleString is more robust:
and also lets you implement additional glue in Python code instead of in C/C++.
> 2) I couldn't understand the differance betwwen the three ?
AnyFile supports interactive devices, RunFile requires you to provide a custom
> 3) What is the difference between the "FILE *fp" and "const char
> *filename" arguments of these functions. If i give a FILE*, why do i
> need to give the file name ?
Python needs the filename to be able to give meaningful error messages.
More information about the Python-list