qprocess

Run command with PyQt5 and getting the stdout and stderr

随声附和 提交于 2021-01-30 09:07:26
问题 I want to run command with PyQt5. And I want to get the stdout and stderr in time order and in real-time. I separated into UI class and Worker class. There are several UI classes, but for simplicity, I've specified just one. I've tried to solve this problem, but I can't. I can't connect between the Worker thread and logger function. test_ui.py import sys import subprocess from PyQt5.QtWidgets import QApplication, QWidget, QHBoxLayout, QVBoxLayout from PyQt5.QtWidgets import QPushButton,

Run command with PyQt5 and getting the stdout and stderr

无人久伴 提交于 2021-01-30 09:05:03
问题 I want to run command with PyQt5. And I want to get the stdout and stderr in time order and in real-time. I separated into UI class and Worker class. There are several UI classes, but for simplicity, I've specified just one. I've tried to solve this problem, but I can't. I can't connect between the Worker thread and logger function. test_ui.py import sys import subprocess from PyQt5.QtWidgets import QApplication, QWidget, QHBoxLayout, QVBoxLayout from PyQt5.QtWidgets import QPushButton,

How to run an external application from Qt program?

穿精又带淫゛_ 提交于 2021-01-29 18:54:45
问题 I'm trying to run an external exe from my Qt app. It's an "autorun application" and it has three buttons: one is suppose to run an external installer which is an .exe app. I tried: system("Setup.exe") It works but it displays terminal when running the installer. I also tried: QProcess::startDetached("Setup.exe"); and also tried: QProcess *process = new QProcess(this); process->start("Setup.exe"); but neither works (nothing happens, there are no logs in the console output as well). Can someone

QProcess fails to execute a terminal line command via QPushButton

南笙酒味 提交于 2021-01-29 05:53:48
问题 I am trying to execute a command line using QProcess as soon as I push a QPushButton on my gui. The problem I have is that the .sh executable file is never executed. The script I am trying to execute is very simple and reported below: #!/bin/bash echo "try one two three" rostopic echo -b LaserScan_PointCloud2_test.bag -p /scan > laserScan_test_1.csv Below the function that activate the button: filterpcdinterface.h private slots: void on_executeScriptBtn_clicked(); private: QProcess

QProcess fails to execute a terminal line command via QPushButton

自作多情 提交于 2021-01-29 05:52:08
问题 I am trying to execute a command line using QProcess as soon as I push a QPushButton on my gui. The problem I have is that the .sh executable file is never executed. The script I am trying to execute is very simple and reported below: #!/bin/bash echo "try one two three" rostopic echo -b LaserScan_PointCloud2_test.bag -p /scan > laserScan_test_1.csv Below the function that activate the button: filterpcdinterface.h private slots: void on_executeScriptBtn_clicked(); private: QProcess

How to read when QProcess need user input with Qt

情到浓时终转凉″ 提交于 2020-11-29 21:20:58
问题 I'm using Qt in order to implement an interface allowing to develop for embedded system. I'm facing a problem: In order to flash program into the embeded system I use QProcess, in order to use the command "make" and "make flash". To make there isn't any problem and the program compiles successfully. But when I try to do the same thing for "make flash" there is a problem because the console is waiting for user input, he has to press a button on the embedded system. But QProcess returns

How to read when QProcess need user input with Qt

北城以北 提交于 2020-11-29 21:15:28
问题 I'm using Qt in order to implement an interface allowing to develop for embedded system. I'm facing a problem: In order to flash program into the embeded system I use QProcess, in order to use the command "make" and "make flash". To make there isn't any problem and the program compiles successfully. But when I try to do the same thing for "make flash" there is a problem because the console is waiting for user input, he has to press a button on the embedded system. But QProcess returns

How to read when QProcess need user input with Qt

拟墨画扇 提交于 2020-11-29 21:15:07
问题 I'm using Qt in order to implement an interface allowing to develop for embedded system. I'm facing a problem: In order to flash program into the embeded system I use QProcess, in order to use the command "make" and "make flash". To make there isn't any problem and the program compiles successfully. But when I try to do the same thing for "make flash" there is a problem because the console is waiting for user input, he has to press a button on the embedded system. But QProcess returns

How to read when QProcess need user input with Qt

╄→гoц情女王★ 提交于 2020-11-29 21:13:22
问题 I'm using Qt in order to implement an interface allowing to develop for embedded system. I'm facing a problem: In order to flash program into the embeded system I use QProcess, in order to use the command "make" and "make flash". To make there isn't any problem and the program compiles successfully. But when I try to do the same thing for "make flash" there is a problem because the console is waiting for user input, he has to press a button on the embedded system. But QProcess returns