void MainWindow::on_pushButton_clicked()
{
setlocale(LC_ALL,"");
QString program = "PyModuleInstaller.bat";
QProcess *Process = new QProcess(this);
Process->start(program);
connect(Process, &QProcess::readyReadStandardOutput, [=] {
ui->plainTextEdit->appendPlainText(Process->readAll());
});
}
此代码应读取 bat 文件的输出并将其发送到纯文本。这是蝙蝠:
chcp 1251
cd /d "C:\Users\Пользователь\AppData\Local\Programs\Python\Python37-32\Scripts"
pip install adsabs
如果你写readError而不是readAll,它不会编译(我不知道如何使用它),如果你readyReadStandardOutput
替换(或添加)readyReadStandardError
错误仍然不显示,只有更多的空行。告诉我如何解决这个问题?
将a替换为
Process->readAll()
_Process->readAllStandardError()
readyReadStandardOutput
readyReadStandardError