I recently making a stoplight program (gui) and i can't figure it out which is wrong I dont know how to include the QTimer or any function for delay to make the color change and i tried the show function ended up getting two programs i really don't know how to fix my code yet can you please help me?

```
import PyQt5, sys, time,os
from os import system,name
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import QPoint,QTimerEvent,QTimer,Qt
from PyQt5.QtWidgets import QWidget,QApplication,QMainWindow
from PyQt5.QtGui import QPainter
class Stoplight(QMainWindow):
    def __init__(self,parent = None):
        QWidget.__init__(self,parent)
        self.setWindowTitle("Stoplight")
        self.setGeometry(500,500,250,510)
    def paintEvent(self,event):
        radx = 50
        rady = 50
        center = QPoint(125,125)
        p = QPainter()
        p.begin(self)
        p.setBrush(Qt.white)
        p.drawRect(event.rect())
        p.end()

        p1 = QPainter()
        p1.begin(self)
        p1.setBrush(Qt.red)
        p1.setPen(Qt.black)
        p1.drawEllipse(center,radx,rady)
        p1.end()
class Stoplight1(Stoplight):
    def __init__(self,parent = None):
        QWidget.__init__(self,parent)
        self.setWindowTitle("Stoplight")
        self.setGeometry(500,500,250,510)
    def paintEvent(self,event):
        radx = 50
        rady = 50
        center = QPoint(125,125)
        p = QPainter()
        p.begin(self)
        p.setBrush(Qt.white)
        p.drawRect(event.rect())
        p.end()

        p1 = QPainter()
        p1.begin(self)
        p1.setBrush(Qt.green)
        p1.setPen(Qt.black)
        p1.drawEllipse(center,radx,rady)
        p1.end()
if __name__ == "__main__":
    application = QApplication(sys.argv)
    stoplight1 = Stoplight()
    stoplight2 = Stoplight1()
    time.sleep(1)
    stoplight1.show()
    time.sleep(1)
    stoplight2.show()
sys.exit(application.exec_())

```