Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. <PYQT>How to Print the output of wget in a QTextBrowser ?
Forum Updated to NodeBB v4.3 + New Features

<PYQT>How to Print the output of wget in a QTextBrowser ?

Scheduled Pinned Locked Moved Language Bindings
1 Posts 1 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dinesh Raja
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved