New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mention Py_SetProgramName in example for very high level embedding #60574
Comments
On Fri, Oct 26, 2012 at 12:02 AM, Tom Epperly <epperly2@llnl.gov> wrote: I recommend adding a Py_SetProgramName() to the example. Regards, Tom Epperly |
Patch for 2.7 applied, the same text should be for 3.2+ Chris, please check my wording as native English speaker. |
Andrew, below is a revision of your comment with a few corrections made by a native english speaker. Function :c:func:`Py_SetProgramName` should be called before :c:func:`Py_Initialize` to inform the interpreter about paths to Python run-time libraries. Next initialize the Python interpreter with :c:func:`Py_Initialize`, followed by the execution of a hard-coded Python script that prints the date and time. Afterwards, the :c:func:`Py_Finalize` call shuts the interpreter down, followed by the end of the program. In a real program, you may want to get the Python script from another source, perhaps a text-editor routine, a file, or a database. Getting the Python code from a file can better be done by using the :c:func:`PyRun_SimpleFile` function, which saves you the trouble of allocating memory space and loading the file contents. |
New changeset 6e24eb832fb2 by Andrew Svetlov in branch '2.7': New changeset 4c35f5ec6acf by Andrew Svetlov in branch '3.2': New changeset b6a5f54e0a34 by Andrew Svetlov in branch '3.3': New changeset 0c1b81465d9c by Andrew Svetlov in branch 'default': |
Thanks, Matt! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: