InterviewSolution
Saved Bookmarks
| 1. |
How Can I Execute Arbitrary Python Statements From C? |
|
Answer» The highest-level function to do this is PyRun_SimpleString() which takes a single string argument to be executed in the context of the module __main__ and returns 0 for success and -1 when an exception occurred (INCLUDING SYNTAXERROR). The highest-level function to do this is PyRun_SimpleString() which takes a single string argument to be executed in the context of the module __main__ and returns 0 for success and -1 when an exception occurred (including SyntaxError). |
|