Interactive device according to the flags argument. Read and execute a single statement from a file associated with an Int PyRun_InteractiveOneFlags (FILE * fp, const char * filename, P圜ompilerFlags * flags ) ¶ This is a simplified interface to PyRun_InteractiveOneFlags() below, Int PyRun_InteractiveOne (FILE * fp, const char * filename ) ¶ Otherwise, Python may not handle script file with LF line ending correctly. On Windows, fp should be opened as binary mode (e.g. The file, it is decoded from filesystem encoding and error handler. Similar to PyRun_SimpleStringFlags(), but the Python source code is readįrom fp instead of an in-memory string. Int PyRun_SimpleFileExFlags (FILE * fp, const char * filename, int closeit, P圜ompilerFlags * flags ) ¶ Int PyRun_SimpleFileEx (FILE * fp, const char * filename, int closeit ) ¶ Leaving closeit set to 0 and flags set to NULL. This is a simplified interface to PyRun_SimpleFileExFlags() below, Int PyRun_SimpleFile (FILE * fp, const char * filename ) ¶ For theįunction will not return -1, but exit the process, as long as There was an error, there is no way to get the exception information. Returns 0 on success or -1 if an exception was raised. Int PyRun_SimpleStringFlags ( const char * command, P圜ompilerFlags * flags ) ¶Įxecutes the Python source code from command in the _main_ moduleĪccording to the flags argument. Leaving the P圜ompilerFlags* argument set to NULL. This is a simplified interface to PyRun_SimpleStringFlags() below, Int PyRun_SimpleString ( const char * command ) ¶ If closeit is true, the file is closed before filename is decoded from the filesystemĮncoding ( sys.getfilesystemencoding()). PyRun_InteractiveLoop(), otherwise return the result of Terminal input or Unix pseudo-terminal), return the value of If fp refers to a file associated with an interactive device (console or Int PyRun_AnyFileExFlags (FILE * fp, const char * filename, int closeit, P圜ompilerFlags * flags ) ¶ Int PyRun_AnyFileEx (FILE * fp, const char * filename, int closeit ) ¶ Int PyRun_AnyFileFlags (FILE * fp, const char * filename, P圜ompilerFlags * flags ) ¶ This is a simplified interface to PyRun_AnyFileExFlags() below, leaving Int PyRun_AnyFile (FILE * fp, const char * filename ) ¶ Similar to Py_Main() but argv is an array of bytes strings. Part of the Stable ABI since version 3.8. Int Py_BytesMain (int argc, char ** argv ) ¶ Note that if an otherwise unhandled SystemExit is raised, thisįunction will not return 1, but exit the process, as long as List does not represent a valid Python command line. The return value willīe 0 if the interpreter exits normally (i.e., without an exception),ġ if the interpreter exits due to an exception, or 2 if the parameter The strings pointed to by the argument list are not). Important to note that the argument list may be modified (but the contents of Prepared exactly as those which are passed to a C program’s main()įunction (converted to wchar_t according to the user’s locale). ![]() The main program for the standard interpreter. Int Py_Main (int argc, wchar_t ** argv ) ¶ The same library that the Python runtime is using. Use different libraries, so care should be taken that FILE* parametersĪre only passed to these functions if it is certain that they were created by Windows (at least), it is possible for dynamically linked extensions to actually Structure for different C libraries can be different and incompatible. Particular issue which needs to be handled carefully is that the FILE Note also that several of these functions take FILE* parameters. These are describedįollowing the functions which accept them as parameters. The available start symbols are Py_eval_input, Several of these functions accept a start symbol from the grammar as a The functions in this chapter will let you execute Python source code given in aįile or a buffer, but they will not let you interact in a more detailed way with
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |