0

Good day, I would like to ask why is my program isn't showing but it's running without errors tried looking for answers but it does not show what I mean

when I run it in python idle or command line or every other builder, it just runs without showing anything. Other scripts are working just fine.

here's the code

#!python3.7
# main.py

from PyQt5.QtWidgets import QMainWindow, QWidget, QPushButton, QBoxLayout,         QVBoxLayout, QHBoxLayout, QApplication, QLabel
import sys, time

class Main(object):

    def __init__(self):
         self.window1 = QWidget()

         self.firstWindow()

         self.window1.show()


    def firstWindow(self):
        vLayout = QVBoxLayout()
        disp = QLabel()
        startTimer = QPushButton()

        startTimer.clicked.connect(Functions.timer())
        vLayout.addWidget(disp)
        vLayout.addWidget(startTimer)

        self.window1.setLayout(vLayout)

class Functions(object):

    def timer(self):
        self.remainingTime = 25

        while(self.remainingTime != 0):
            self.remainingTime -= 1
            time.sleep(60)
            Main.firstWindow.disp.setText(self.remainingTime)

class Control(QMainWindow):

    def __init__(self):
        super().__init__()
        self.setGeometry(50, 50, 700, 400)
        self.setWindowTitle("Pomodoro Timer")


if __name__ == "__main__":
    app = QApplication([])
    window = Control()
    app.exit(app.exec_())

0 Answers0