Executing shell script from c++ code



  • Here is fragment of my code:

    @ //-------------------
    void MainWindow::CodeAsterError()
    {
    ui->textBrowserError->append(caProcess->readAllStandardError());
    }

    void MainWindow::CodeAsterOut()
    {
        QByteArray byteArray=caProcess->readAllStandardOutput();
        QStringList strLines=QString(byteArray).split("\n");
     
        foreach (QString line,strLines)
        {
            ui->textBrowserOut->append(line);
        }
    }
     
    void MainWindow::on_pushButton_clicked()
    {
        QString program="/home/oogolov/aster/bin/as_run";
        QStringList arguments;
        arguments << "/home/oogolov/GeoFEA/GeoFEA2D/WorkDir/Calc.export";
     
        connect (caProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(CodeAsterOut()));
        connect (caProcess, SIGNAL(readyReadStandardError()), this, SLOT(CodeAsterError()));
     
        caProcess->start(program,arguments);
        //caProcess->start("/bin/bash", QStringList() << "/home/oogolov/aster/bin/as_run" << "/home/oogolov/GeoFEA/GeoFEA2D/WorkDir/Calc.export");
        // commented operator works too
        caProcess->waitForReadyRead(100);
    }
    //----------------------
    

    @

    When I run (Build/Run) my application it works. But when I debug (Debug/Start Debugging) I get following error:


    Traceback (most recent call last):
    File "<string>", line 1, in <module>

    File "/home/oogolov/aster/lib/python2.7/site-packages/asrun/main.py", line 109, in main
    start()
    File "/home/oogolov/aster/lib/python2.7/site-packages/asrun/main.py", line 51, in start
    run = AsterRun()
    File "/home/oogolov/aster/lib/python2.7/site-packages/asrun/run.py", line 186, in init
    self.LoadExtensions()
    File "/home/oogolov/aster/lib/python2.7/site-packages/asrun/run.py", line 297, in LoadExtensions
    import asrun.maintenance
    File "/home/oogolov/aster/lib/python2.7/site-packages/asrun/maintenance.py", line 42, in <module>

    from asrun.build import AsterBuild
    File "/home/oogolov/aster/lib/python2.7/site-packages/asrun/build.py", line 31, in <module>
    from zipfile import ZipFile
    File "/opt/QtSDK/debugger/Desktop/lib/python2.7/zipfile.py", line 6, in <module>
    import io
    File "/opt/QtSDK/debugger/Desktop/lib/python2.7/io.py", line 60, in <module>
    import _io
    ImportError: /opt/QtSDK/debugger/Desktop/lib/python2.7/lib-dynload/_io.so: undefined symbol: PyUnicodeUCS2_FromObject


    Could you help me to repair this "ImportError, PyUnicodeUCS2_FromObject" error situation?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.