12#ifndef PYTHON_INTERPRETER_H
13#define PYTHON_INTERPRETER_H
15#define PY_SSIZE_T_CLEAN
44 QObject* parent =
nullptr);
68 void execute(std::
string const& line);
81 virtual
void write(QString const& command) override final;
97 int runFile(QString const& filePath);
108 bool redirectIO(
bool interactive);
120 void printPrompt() const;
127 std::
string inputBuffer_{ };
130 bool printPrompt_{
true };
133 bool runMultiline_{
false };
142 PyObject* globalContext_{
nullptr };
145 PyObject* localContext_{
nullptr };
148 PyThreadState* threadState_{
nullptr };
PythonInterpreter(WriteChannel *outputChannel, WriteChannel *errorChannel, bool printPromt=true, QObject *parent=nullptr)
~PythonInterpreter() final=default
bool initialize(bool interactive=true)
int runFile(QString const &filePath)
void execute(std::string const &line)
void executeString(QString const &string)
virtual void write(QString const &command) override final
WriteChannel()=default
The constructor.