Код: Выделить всё
#include
#include
#include
#include
#include
#include
#include
#include "pybind11/pybind11.h"
#include "pybind11/embed.h"
namespace py = pybind11;
std::atomic stopped(false);
std::atomic executed(false);
void python_executor(const std::string &code)
{
py::gil_scoped_acquire acquire;
try
{
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79790590/how-do-i-interrupt-a-pybind11-exec-call[/url]