Error, could not create TXT output file: No such file or directory
tesseract ./downloads/en.jpg outputs/1585336201.287781output -l eng
- это ошибка, с которой у меня возникли проблемы, эта команда отлично работает из скрипта python, но не через дочерний процесс, загрузки и скрипт .py находятся в одной папке, и обе они в папке рядом с nodejs script
это метод, который я вызываю из функции post, чтобы дать ему представление о том, что мне нужно транскрибировать, тогда сценарий python не может запустить команда tesseract, даже если она может выполнить ее вручную
const verif = async (fileName, filePath) => {
var uint8arrayToString = function(data){
return String.fromCharCode.apply(null, data);
};
const spawn = require('child_process').spawn;
const scriptExecution = spawn('python',['-u', './diploma/app.py']);
var data = JSON.stringify([fileName]);
scriptExecution.stdin.write(data);
scriptExecution.stdin.end();
scriptExecution.stdout.on('data', (data) => {
console.log(uint8arrayToString(data));
});
scriptExecution.stderr.on('data', (data) => {
// As said before, convert the Uint8Array to a readable string.
console.log(uint8arrayToString(data));
});
scriptExecution.on('exit', (code) => {
console.log("Process quit with code : " + code);
});
return true;
}