luchete80 / WeldFormGUI

GNU General Public License v3.0
1 stars 0 forks source link

Replace Std::output to console or log #48

Open luchete80 opened 1 month ago

luchete80 commented 1 month ago
    // Only if 'RunMode' is set to 'Gui' do the replacement
    if (App::Application::Config()["RunMode"] == "Gui") {
        Base::Interpreter().replaceStdOutput();
    }
luchete80 commented 1 month ago

From FreeCAD Base::Interpreter().replaceStdOutput();

PyGILStateLocker locker; PythonStdOutput* out = new PythonStdOutput(); PySys_SetObject("stdout", out); PySys_SetObject("stderr", out);

luchete80 commented 1 month ago

https://github.com/mloskot/workshop/blob/master/python/emb/emb.cpp

https://stackoverflow.com/questions/4307187/how-to-catch-python-stdout-in-c-code

luchete80 commented 3 days ago

FIRST THING (python terminal) is done!

luchete80 commented 3 days ago

python console output is added in f7daf70