There is a button that runs the os.system('sudo apt-get update')
command when the button is clicked.
Simultaneously, I'd like to display a progress bar while the command are running.
Should I use Thread? How can I do this in PyQt5 ?
class MyApp(QMainWindow):
def __init__(self):
super(MyApp, self).__init__()
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.ui.Button.clicked.connect(self.onButtonClick)
def onButtonClick(self):
os.system('sudo apt-get update')
if __name__ == "__main__":
app = QApplication(sys.argv)
window = MyApp()
window.show()
sys.exit(app.exec_())
Thank you for your help.