Running GREP from QProcess (pyqt4)
-
Hello,
I just can't get this to run correctly. I am trying to run the grep via QProcess, as follows:
self.process = QtCore.QProcess()
self.arguments_test = QtCore.QStringList()self.arguments_test << "-rn" << "hello" << "/home/user/*";
self.process.start("grep", self.arguments_test)
self.process.waitForFinished()I get : <PyQt4.QtCore.QStringList object at 0xb4776df4>
I've tried running simpler commands such as ls, with parameters too and it works.
Thanks in advance.
-
Hi dangelog your code works perfectly.A ton of thaks to you.But i am searching for a way to provide the search pattern name in a variable so that the user can give any pattern to search
QString pattern = "hello";
options << "-c" << "grep -r -w -i -o -c "<<pattern<<" hello /tmp/* ";doesn't work...