We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
add -e/--executable to poetry env info to get the python executable path
- [x] I have searched the [issues](https://github.com/python-poetry/poetry/issues) of this repo and believe that this is not a duplicate.
- [x] I have searched the [FAQ](https://python-poetry.org/docs/faq/) and general [documentation](https://python-poetry.org/docs/) and believe that my question is not already covered.

## Feature Request

in addition to the already present `-p/--path` option, add a `-e/--execuatble` option to return the python executable path.

My use case: I'm starting to use Taskfile and poetry on some projects; these project are developed on both linux and windows;

I would like to avoid having to install tools such as mypy in the virtual environment, since they can be run from the outside (this also allows me to have faster CI, I have set up a custom docker image with all the tools needed).

mypy in particular wants to know the exact path of the python executable to work (passed as `--python-executable` option), so having a new `poetry env info --executable` option that outputs the python path  would solve my issue in a cross-platform fashion.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/poetry/console/commands/env/info.py`
Content:
```
1 from __future__ import annotations
2 
3 from typing import TYPE_CHECKING
4 
5 from cleo.helpers import option
6 
7 from poetry.console.commands.command import Command
8 
9 
10 if TYPE_CHECKING:
11     from poetry.utils.env import Env
12 
13 
14 class EnvInfoCommand(Command):
15     name = "env info"
16     description = "Displays information about the current environment."
17 
18     options = [option("path", "p", "Only display the environment's path.")]
19 
20     def handle(self) -> int:
21         from poetry.utils.env import EnvManager
22 
23         env = EnvManager(self.poetry).get()
24 
25         if self.option("path"):
26             if not env.is_venv():
27                 return 1
28 
29             self.line(str(env.path))
30 
31             return 0
32 
33         self._display_complete_info(env)
34         return 0
35 
36     def _display_complete_info(self, env: Env) -> None:
37         env_python_version = ".".join(str(s) for s in env.version_info[:3])
38         self.line("")
39         self.line("<b>Virtualenv</b>")
40         listing = [
41             f"<info>Python</info>:         <comment>{env_python_version}</>",
42             f"<info>Implementation</info>: <comment>{env.python_implementation}</>",
43             (
44                 "<info>Path</info>:          "
45                 f" <comment>{env.path if env.is_venv() else 'NA'}</>"
46             ),
47             (
48                 "<info>Executable</info>:    "
49                 f" <comment>{env.python if env.is_venv() else 'NA'}</>"
50             ),
51         ]
52         if env.is_venv():
53             listing.append(
54                 "<info>Valid</info>:         "
55                 f" <{'comment' if env.is_sane() else 'error'}>{env.is_sane()}</>"
56             )
57         self.line("\n".join(listing))
58 
59         self.line("")
60 
61         system_env = env.parent_env
62         python = ".".join(str(v) for v in system_env.version_info[:3])
63         self.line("<b>System</b>")
64         self.line(
65             "\n".join(
66                 [
67                     f"<info>Platform</info>:   <comment>{env.platform}</>",
68                     f"<info>OS</info>:         <comment>{env.os}</>",
69                     f"<info>Python</info>:     <comment>{python}</>",
70                     f"<info>Path</info>:       <comment>{system_env.path}</>",
71                     f"<info>Executable</info>: <comment>{system_env.python}</>",
72                 ]
73             )
74         )
75
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/poetry/console/commands/env/info.py b/src/poetry/console/commands/env/info.py
--- a/src/poetry/console/commands/env/info.py
+++ b/src/poetry/console/commands/env/info.py
@@ -15,7 +15,12 @@
     name = "env info"
     description = "Displays information about the current environment."
 
-    options = [option("path", "p", "Only display the environment's path.")]
+    options = [
+        option("path", "p", "Only display the environment's path."),
+        option(
+            "executable", "e", "Only display the environment's python executable path."
+        ),
+    ]
 
     def handle(self) -> int:
         from poetry.utils.env import EnvManager
@@ -30,6 +35,14 @@
 
             return 0
 
+        if self.option("executable"):
+            if not env.is_venv():
+                return 1
+
+            self.line(str(env.python))
+
+            return 0
+
         self._display_complete_info(env)
         return 0

{"golden_diff": "diff --git a/src/poetry/console/commands/env/info.py b/src/poetry/console/commands/env/info.py\n--- a/src/poetry/console/commands/env/info.py\n+++ b/src/poetry/console/commands/env/info.py\n@@ -15,7 +15,12 @@\n     name = \"env info\"\n     description = \"Displays information about the current environment.\"\n \n-    options = [option(\"path\", \"p\", \"Only display the environment's path.\")]\n+    options = [\n+        option(\"path\", \"p\", \"Only display the environment's path.\"),\n+        option(\n+            \"executable\", \"e\", \"Only display the environment's python executable path.\"\n+        ),\n+    ]\n \n     def handle(self) -> int:\n         from poetry.utils.env import EnvManager\n@@ -30,6 +35,14 @@\n \n             return 0\n \n+        if self.option(\"executable\"):\n+            if not env.is_venv():\n+                return 1\n+\n+            self.line(str(env.python))\n+\n+            return 0\n+\n         self._display_complete_info(env)\n         return 0\n", "issue": "add -e/--executable to poetry env info to get the python executable path\n- [x] I have searched the [issues](https://github.com/python-poetry/poetry/issues) of this repo and believe that this is not a duplicate.\r\n- [x] I have searched the [FAQ](https://python-poetry.org/docs/faq/) and general [documentation](https://python-poetry.org/docs/) and believe that my question is not already covered.\r\n\r\n## Feature Request\r\n\r\nin addition to the already present `-p/--path` option, add a `-e/--execuatble` option to return the python executable path.\r\n\r\nMy use case: I'm starting to use Taskfile and poetry on some projects; these project are developed on both linux and windows;\r\n\r\nI would like to avoid having to install tools such as mypy in the virtual environment, since they can be run from the outside (this also allows me to have faster CI, I have set up a custom docker image with all the tools needed).\r\n\r\nmypy in particular wants to know the exact path of the python executable to work (passed as `--python-executable` option), so having a new `poetry env info --executable` option that outputs the python path  would solve my issue in a cross-platform fashion.\r\n\n", "before_files": [{"content": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom cleo.helpers import option\n\nfrom poetry.console.commands.command import Command\n\n\nif TYPE_CHECKING:\n    from poetry.utils.env import Env\n\n\nclass EnvInfoCommand(Command):\n    name = \"env info\"\n    description = \"Displays information about the current environment.\"\n\n    options = [option(\"path\", \"p\", \"Only display the environment's path.\")]\n\n    def handle(self) -> int:\n        from poetry.utils.env import EnvManager\n\n        env = EnvManager(self.poetry).get()\n\n        if self.option(\"path\"):\n            if not env.is_venv():\n                return 1\n\n            self.line(str(env.path))\n\n            return 0\n\n        self._display_complete_info(env)\n        return 0\n\n    def _display_complete_info(self, env: Env) -> None:\n        env_python_version = \".\".join(str(s) for s in env.version_info[:3])\n        self.line(\"\")\n        self.line(\"<b>Virtualenv</b>\")\n        listing = [\n            f\"<info>Python</info>:         <comment>{env_python_version}</>\",\n            f\"<info>Implementation</info>: <comment>{env.python_implementation}</>\",\n            (\n                \"<info>Path</info>:          \"\n                f\" <comment>{env.path if env.is_venv() else 'NA'}</>\"\n            ),\n            (\n                \"<info>Executable</info>:    \"\n                f\" <comment>{env.python if env.is_venv() else 'NA'}</>\"\n            ),\n        ]\n        if env.is_venv():\n            listing.append(\n                \"<info>Valid</info>:         \"\n                f\" <{'comment' if env.is_sane() else 'error'}>{env.is_sane()}</>\"\n            )\n        self.line(\"\\n\".join(listing))\n\n        self.line(\"\")\n\n        system_env = env.parent_env\n        python = \".\".join(str(v) for v in system_env.version_info[:3])\n        self.line(\"<b>System</b>\")\n        self.line(\n            \"\\n\".join(\n                [\n                    f\"<info>Platform</info>:   <comment>{env.platform}</>\",\n                    f\"<info>OS</info>:         <comment>{env.os}</>\",\n                    f\"<info>Python</info>:     <comment>{python}</>\",\n                    f\"<info>Path</info>:       <comment>{system_env.path}</>\",\n                    f\"<info>Executable</info>: <comment>{system_env.python}</>\",\n                ]\n            )\n        )\n", "path": "src/poetry/console/commands/env/info.py"}], "after_files": [{"content": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom cleo.helpers import option\n\nfrom poetry.console.commands.command import Command\n\n\nif TYPE_CHECKING:\n    from poetry.utils.env import Env\n\n\nclass EnvInfoCommand(Command):\n    name = \"env info\"\n    description = \"Displays information about the current environment.\"\n\n    options = [\n        option(\"path\", \"p\", \"Only display the environment's path.\"),\n        option(\n            \"executable\", \"e\", \"Only display the environment's python executable path.\"\n        ),\n    ]\n\n    def handle(self) -> int:\n        from poetry.utils.env import EnvManager\n\n        env = EnvManager(self.poetry).get()\n\n        if self.option(\"path\"):\n            if not env.is_venv():\n                return 1\n\n            self.line(str(env.path))\n\n            return 0\n\n        if self.option(\"executable\"):\n            if not env.is_venv():\n                return 1\n\n            self.line(str(env.python))\n\n            return 0\n\n        self._display_complete_info(env)\n        return 0\n\n    def _display_complete_info(self, env: Env) -> None:\n        env_python_version = \".\".join(str(s) for s in env.version_info[:3])\n        self.line(\"\")\n        self.line(\"<b>Virtualenv</b>\")\n        listing = [\n            f\"<info>Python</info>:         <comment>{env_python_version}</>\",\n            f\"<info>Implementation</info>: <comment>{env.python_implementation}</>\",\n            (\n                \"<info>Path</info>:          \"\n                f\" <comment>{env.path if env.is_venv() else 'NA'}</>\"\n            ),\n            (\n                \"<info>Executable</info>:    \"\n                f\" <comment>{env.python if env.is_venv() else 'NA'}</>\"\n            ),\n        ]\n        if env.is_venv():\n            listing.append(\n                \"<info>Valid</info>:         \"\n                f\" <{'comment' if env.is_sane() else 'error'}>{env.is_sane()}</>\"\n            )\n        self.line(\"\\n\".join(listing))\n\n        self.line(\"\")\n\n        system_env = env.parent_env\n        python = \".\".join(str(v) for v in system_env.version_info[:3])\n        self.line(\"<b>System</b>\")\n        self.line(\n            \"\\n\".join(\n                [\n                    f\"<info>Platform</info>:   <comment>{env.platform}</>\",\n                    f\"<info>OS</info>:         <comment>{env.os}</>\",\n                    f\"<info>Python</info>:     <comment>{python}</>\",\n                    f\"<info>Path</info>:       <comment>{system_env.path}</>\",\n                    f\"<info>Executable</info>: <comment>{system_env.python}</>\",\n                ]\n            )\n        )\n", "path": "src/poetry/console/commands/env/info.py"}]}