![]() |
Shamrock 2025.10.0
Astrophysical Code
|
#include "shambase/popen.hpp"#include "shambase/print.hpp"#include "shambindings/locate_pylib.hpp"#include "shambindings/pybindaliases.hpp"#include "shambindings/pybindings.hpp"#include "shambindings/start_python.hpp"#include <pybind11/embed.h>#include <pybind11/stl.h>#include <cstdlib>#include <optional>#include <string>
Include dependency graph for start_python.cpp:Go to the source code of this file.
Functions | |
| const char * | configure_time_py_sys_path () |
| path of the script to generate sys.path | |
| const char * | configure_time_py_executable () |
| path of the python executable that was used to configure sys.path | |
| const char * | run_ipython_src () |
| Script to run ipython. | |
| std::string | get_pypath () |
| Retrieves the Python path to be used for the application. | |
| void | shambindings::setpypath (std::string path) |
| set the value of sys.path before init | |
| void | shambindings::setpypath_from_binary (std::string binary_path) |
| set the value of sys.path before init from the supplied binary | |
| void | shambindings::modify_py_sys_path (bool do_print) |
| Modify Python sys.path to point to one detected during cmake invocation. | |
| void | shambindings::set_sys_argv (int argc, char *argv[]) |
| set the value of sys.argv | |
| void | shambindings::start_ipython (bool do_print, int argc, char *argv[]) |
| Start shamrock embded ipython interpreter. | |
| void | shambindings::run_py_file (std::string file_path, bool do_print, int argc, char *argv[]) |
| run python runscript | |
Variables | |
| std::optional< std::string > | runtime_set_pypath = std::nullopt |
| value use to set the value of sys.path if set by the user at runtime | |
| std::string | check_python_is_excpeted_version |
| Script to check that the python distrib is the expected one. | |
Definition in file start_python.cpp.
|
extern |
path of the script to generate sys.path
| std::string get_pypath | ( | ) |
Retrieves the Python path to be used for the application.
This function returns the Python path that should be used, prioritizing the runtime-set value if available. If no runtime value is set, it defaults to the path configured during the application's build time.
Definition at line 57 of file start_python.cpp.
Here is the call graph for this function:| void shambindings::modify_py_sys_path | ( | bool | do_print | ) |
Modify Python sys.path to point to one detected during cmake invocation.
This function will throw if bindings were not initialized in embed mode
Definition at line 96 of file start_python.cpp.
Here is the call graph for this function:| void shambindings::run_py_file | ( | std::string | file_path, |
| bool | do_print, | ||
| int | argc, | ||
| char * | argv[] | ||
| ) |
run python runscript
This function will throw if bindings were not initialized in embed mode
| do_print | print log at python startup |
| file_path | path to the runscript |
Definition at line 142 of file start_python.cpp.
Here is the call graph for this function:| void shambindings::set_sys_argv | ( | int | argc, |
| char * | argv[] | ||
| ) |
set the value of sys.argv
This function will throw if bindings were not initialized in embed mode
Definition at line 118 of file start_python.cpp.
Here is the call graph for this function:| void shambindings::setpypath | ( | std::string | path | ) |
set the value of sys.path before init
This function will throw if bindings were not initialized in embed mode
Definition at line 88 of file start_python.cpp.
Here is the call graph for this function:| void shambindings::setpypath_from_binary | ( | std::string | binary_path | ) |
set the value of sys.path before init from the supplied binary
This function will throw if bindings were not initialized in embed mode
Definition at line 90 of file start_python.cpp.
Here is the call graph for this function:| void shambindings::start_ipython | ( | bool | do_print, |
| int | argc, | ||
| char * | argv[] | ||
| ) |
Start shamrock embded ipython interpreter.
This function will throw if bindings were not initialized in embed mode
| do_print | print log at python startup |
Definition at line 123 of file start_python.cpp.
Here is the call graph for this function:| std::string check_python_is_excpeted_version |
Script to check that the python distrib is the expected one.
Definition at line 66 of file start_python.cpp.
| std::optional<std::string> runtime_set_pypath = std::nullopt |
value use to set the value of sys.path if set by the user at runtime
Definition at line 46 of file start_python.cpp.