FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.13] gh-141004: Document `PyRun_InteractiveOneObject` (GH-141405) by miss-islington · Pull Request #141486 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
25 changes: 16 additions & 9 deletions Doc/c-api/veryhigh.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,12 @@ the same library that the Python runtime is using.
Otherwise, Python may not handle script file with LF line ending correctly.


.. c:function:: int PyRun_InteractiveOne(FILE *fp, const char *filename)

This is a simplified interface to :c:func:`PyRun_InteractiveOneFlags` below,
leaving *flags* set to ``NULL``.


.. c:function:: int PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
.. c:function:: int PyRun_InteractiveOneObject(FILE *fp, PyObject *filename, PyCompilerFlags *flags)

Read and execute a single statement from a file associated with an
interactive device according to the *flags* argument. The user will be
prompted using ``sys.ps1`` and ``sys.ps2``. *filename* is decoded from the
:term:`filesystem encoding and error handler`.
prompted using ``sys.ps1`` and ``sys.ps2``. *filename* must be a Python
:class:`str` object.

Returns ``0`` when the input was
executed successfully, ``-1`` if there was an exception, or an error code
Expand All @@ -120,6 +114,19 @@ the same library that the Python runtime is using.
:file:`Python.h`, so must be included specifically if needed.)


.. c:function:: int PyRun_InteractiveOne(FILE *fp, const char *filename)

This is a simplified interface to :c:func:`PyRun_InteractiveOneFlags` below,
leaving *flags* set to ``NULL``.


.. c:function:: int PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)

Similar to :c:func:`PyRun_InteractiveOneObject`, but *filename* is a
:c:expr:`const char*`, which is decoded from the
:term:`filesystem encoding and error handler`.


.. c:function:: int PyRun_InteractiveLoop(FILE *fp, const char *filename)

This is a simplified interface to :c:func:`PyRun_InteractiveLoopFlags` below,
Expand Down
Loading

Back | FazBrowse Home | New Git URL