<PYQT>How to Print the output of wget in a QTextBrowser ?
-
Hi I am completely new to Pyqt programming and in the process of learning i am developing a small application (Front end for "wget") here is the code which i have made so far
@import sys
from PyQt4 import QtGui, QtCore
import subprocess
class Home(QtGui.QWidget):
def init(self):
QtGui.QMainWindow.init(self)
self.setWindowTitle('Dinesh Downloader')
self.vbox = QtGui.QVBoxLayout()
self.setLayout(self.vbox)
self.FileNameLabel = QtGui.QLabel('No file selected')
self.vbox.addWidget(self.FileNameLabel)
FileChooserButton = QtGui.QPushButton('Choose file', self)
self.vbox.addWidget(FileChooserButton)
self.connect(FileChooserButton, QtCore.SIGNAL('clicked()'), self.get_fname)
Output=QtGui.QTextEdit()
self.vbox.addWidget(Output)
def get_fname(self):
fname = QtGui.QFileDialog.getOpenFileName(self, 'Select file')
subprocess.call(["wget", "-i", fname])
if fname:
self.FileNameLabel.setText(fname)
else:
self.FileNameLabel.setText('No file selected')if name == "main":
app = QtGui.QApplication(sys.argv)
gui = Home()
gui.show()
app.exec_()@Now its running good but the output of wget is being printed in Terminal but i want the out put to be printed in QTextEdit here i have named it as Output
I request all of you to help by guiding me to complete the code please.
Thank You!