Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog/150.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify the executable paths accepted by ``try_first_with`` in the standalone usage example.
8 changes: 4 additions & 4 deletions docs/how-to/standalone-usage.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
How-to guides
=============

Search specific directories first
-----------------------------------
Try specific executables first
------------------------------

If you know a likely location for the interpreter, pass it via ``try_first_with`` to check there
If you know the path to an interpreter executable, pass it via ``try_first_with`` to check it
before the normal search. This is useful when you have a custom Python install outside the
standard locations.

.. code-block:: python

from python_discovery import get_interpreter

info = get_interpreter("python3.12", try_first_with=["/opt/python/bin"])
info = get_interpreter("python3.12", try_first_with=["/opt/python/bin/python3.12"])
if info is not None:
print(info.executable)

Expand Down