0

Can't print a LineEdit value in UI Pyqt5 python Nothing appears when I press the button I want every print command in the terminal to appear in the UI logs App I showed in the picture below what I want exactly

enter image description here

import subprocess
from PyQt5 import QtCore, QtGui, QtWidgets
from Main import Ui_MainWindow
import sys
from subprocess import call
import os

######################
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()

##### READ INFO BGIN ##########


def info_D():
    subprocess.call("adb devices", shell=True)
    print("Detecting device information....")
    print("--------------------------------------")
    subprocess.call("adb shell getprop ro.boot.veritymode > verity.txt", shell=True)
    with open('verity.txt') as myfile:
        verity = myfile.read()
    subprocess.call("adb shell getprop debug.mtklog.netlog.Running > mtk.txt", shell=True)
    with open('mtk.txt') as myfile:
        mtk = myfile.read()
    subprocess.call("adb shell getprop ro.product.model > device.txt", shell=True)
    with open('device.txt') as myfile:
        device = myfile.read()
    subprocess.call("adb shell getprop ro.hardware > platform.txt", shell=True)
    with open('platform.txt') as myfile:
        platform = myfile.read()
    subprocess.call("adb shell getprop ro.product.cpu.abi > arch.txt", shell=True)
    with open('arch.txt') as myfile:
        arch = myfile.read()
    subprocess.call("adb shell getprop ro.build.version.release > android.txt", shell=True)
    with open('android.txt') as myfile:
        android = myfile.read()
    print("Device: " + device)
    print("ARCH: " + arch)
    print("Platform: " + platform)
    print("Android: " + android)
    print("mtk: " + mtk)
    print("verity: " + verity)
    print("--------------------------------------")

    ui.lineEdit.setText()




##### READ INFO END ##########
ui.R_info.clicked.connect(info_D)

sys.exit(app.exec_())
Amitai Irron
  • 1,973
  • 1
  • 12
  • 14
BASHEER
  • 1
  • 3
  • use `print(ui.lineEdit.text())` – eyllanesc Jun 10 '20 at 22:15
  • @eyllanesc Nothing has changed – BASHEER Jun 10 '20 at 22:31
  • I think your question does not reflect your real goal. According to your question you want to print the QLineEdit text, but from your image I deduce that you want the log generated by ADB to be shown in the QPlainTextEdit (or QTextEdit), I recommend you edit your question and improve it, maybe seek the help of a friend who help you in writing your question. – eyllanesc Jun 10 '20 at 22:34

0 Answers0