qprocess

QProcess: not receiving finished() signal running Powershell script

[亡魂溺海] 提交于 2021-02-20 04:36:01
问题 I am developing a Qt application that, among other things, converts an Excel spreadsheet in a text delimited with tab file. This is done by running a Windows Powershell script. My problem is that the finished() signal from the QProcess is never emitted, although the conversion is done successfully. And yes, I receive stateChanged() signal. Powershell script (ps_excel.ps1) (adapted from this question) param ([string]$ent = $null, [string]$sal = $null) $xlCSV = -4158 #value for tab delimited

QProcess: not receiving finished() signal running Powershell script

痴心易碎 提交于 2021-02-20 04:34:07
问题 I am developing a Qt application that, among other things, converts an Excel spreadsheet in a text delimited with tab file. This is done by running a Windows Powershell script. My problem is that the finished() signal from the QProcess is never emitted, although the conversion is done successfully. And yes, I receive stateChanged() signal. Powershell script (ps_excel.ps1) (adapted from this question) param ([string]$ent = $null, [string]$sal = $null) $xlCSV = -4158 #value for tab delimited

QProcess: not receiving finished() signal running Powershell script

六月ゝ 毕业季﹏ 提交于 2021-02-20 04:34:06
问题 I am developing a Qt application that, among other things, converts an Excel spreadsheet in a text delimited with tab file. This is done by running a Windows Powershell script. My problem is that the finished() signal from the QProcess is never emitted, although the conversion is done successfully. And yes, I receive stateChanged() signal. Powershell script (ps_excel.ps1) (adapted from this question) param ([string]$ent = $null, [string]$sal = $null) $xlCSV = -4158 #value for tab delimited

Set arguments with diffrent formats in QProcess

本秂侑毒 提交于 2021-02-17 05:50:22
问题 I want to run a python script in my qt project after clicking a pushButton using QProcess. This is my code : void MainWindow::on_pushButton_clicked() { QProcess p; QStringList params; QString pythonPath = "C:/Python/python.exe"; QString pythonScript = "C:\\Users\\melek\\Desktop\\user_interface\\user_interface-master\\match.py"; params << pythonScript; QStringList arguments; arguments <<"-t1"<<"start.png"<<"-t2"<< "end.png"<<"-i"<< "images_"; p.setArguments(arguments); p.start(pythonPath,

Printing QProcess Stdout only if it contains a Substring

夙愿已清 提交于 2021-02-10 16:01:36
问题 A PyQt4 app runs ping in a QProcess . A QTextEdit named self.output will output everything from ping . A second QTextEdit named self.summary will only output the line if it contains the string TTL . Problem: I have managed to get self.output working but not self.summary as I am not sure how to write its code in the dataReady function. Any ideas? import sys from PyQt4 import QtGui, QtCore class MainWindow(QtGui.QMainWindow): def __init__(self): super(MainWindow, self).__init__() self.initUI()

Printing QProcess Stdout only if it contains a Substring

我只是一个虾纸丫 提交于 2021-02-10 16:00:40
问题 A PyQt4 app runs ping in a QProcess . A QTextEdit named self.output will output everything from ping . A second QTextEdit named self.summary will only output the line if it contains the string TTL . Problem: I have managed to get self.output working but not self.summary as I am not sure how to write its code in the dataReady function. Any ideas? import sys from PyQt4 import QtGui, QtCore class MainWindow(QtGui.QMainWindow): def __init__(self): super(MainWindow, self).__init__() self.initUI()

Printing QProcess Stdout only if it contains a Substring

梦想的初衷 提交于 2021-02-10 16:00:27
问题 A PyQt4 app runs ping in a QProcess . A QTextEdit named self.output will output everything from ping . A second QTextEdit named self.summary will only output the line if it contains the string TTL . Problem: I have managed to get self.output working but not self.summary as I am not sure how to write its code in the dataReady function. Any ideas? import sys from PyQt4 import QtGui, QtCore class MainWindow(QtGui.QMainWindow): def __init__(self): super(MainWindow, self).__init__() self.initUI()

GUI Freezing with QThreading and QProcess

回眸只為那壹抹淺笑 提交于 2021-02-08 07:39:40
问题 I'm attempting to write some software that will process large amounts of images collected from some crystallography experiments. The data process involves the following steps: User Input to determine the number of images to batch together. A directory containing the images is selected, and the total number of images is calculated. A nested for loop is used to batch images together, and construct a command and arguments for each batch which is processed using a batch file. The following code

PyQt: Multiple QProcess and output

时光总嘲笑我的痴心妄想 提交于 2021-02-08 03:38:55
问题 I have a PyQt window that calls multiple executables as QProcess. How can I list the outputs of each process after the last one has finished? (something like process_result = ["result1", "result2",..]) Let us say it looks like this: for i in list_of_processes: process = QtCore.QProcess() process.start(i) I can read with process.readyReadStandardOutput() somehow but it is quite chaotic because processes run parallel. process.waitForFinished() does not work because the GUI will freeze. Also, I

Cannot redirect Pyinstaller single executable output while running it in subprocess

笑着哭i 提交于 2021-02-05 11:21:06
问题 I've been struggling with this for quite a while. I've managed to write a code that can capture STDOUT of .py files, however when I run the exact same code with executable generated from Pyinstaller (doesn't matter whether it's windowed or not) the readyReadStandardOutput signal doesn't ever come up. From my tests it occurs that any signal at all is emitted only when the app crashes, however I need a live communication between the GUI and the executable. Here's my code for reference: def