I have a script (in Python), that is called by another script (in JavaScript). And to have better readability of the log in my command line, I’d like that all the prints of the subscript (in Python) start with a tabulation. Is there a way to do that with one command, or should I put manually a t
at the beginning of all my print?
I wanted to add the tab in the calling script, but when there are several prints in a row, only the first one gets the tab.
PS: if it can help, the calling of the Python script:
const spawn = require("child_process").spawn;
const pythonProcess = spawn('python3', ["../pythonscript.py"]);
pythonProcess.stdout.on('data', (data) => {
buff = Buffer.from(data.toString().trim(), "utf-8");
console.log('Python answer = ' + buff.toString());
});