from PyQt5.QtCore import Qt, QTime, QTimer
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from screen3 import *

time = QTime(0, 0, 15)

class SecondWin(QWidget):
def init(self):
super().init()
self.look()
self.initUI()
self.connect()

def look(self):
self.setWindowTitle(‘2nd screen’)
self.resize(600, 400)

def initUI(self):
# Create widgets
self.fio_text = QLabel(‘Input your full name’)
self.fiole = QLineEdit()
self.age_text = QLabel(‘How old are you?’)
self.agele = QLineEdit()
self.instruction21_text = QLabel(‘Instruction Zamer1’)
self.button_test = QPushButton(‘Start Test’)
self.rsult1le = QLineEdit()
self.instruction22_text = QLabel(‘Instruction sits’)
self.button_sits = QPushButton(‘Start sits’)
self.instruction23_text = QLabel(‘Long instruction’)
self.button_finaltest = QPushButton(‘Start Final Test’)
self.result2le = QLineEdit()
self.result3le = QLineEdit()
self.button = QPushButton(‘Send your results’)
self.text_timer = QLabel(time.toString(‘hh:mm:ss’))
self.text_timer.setFont(QFont(‘times’, 36, QFont.Bold))

# Create layouts
self.main_hbl = QHBoxLayout()
self.left_vbl = QVBoxLayout()
self.right_vbl = QVBoxLayout()
self.setLayout(self.main_hbl)

# Add widgets to layouts
self.main_hbl.addLayout(self.left_vbl)
self.main_hbl.addLayout(self.right_vbl)

self.left_vbl.addWidget(self.fio_text)
self.left_vbl.addWidget(self.fiole)
self.left_vbl.addWidget(self.age_text)
self.left_vbl.addWidget(self.agele)
self.left_vbl.addWidget(self.instruction21_text)
self.left_vbl.addWidget(self.button_test)
self.left_vbl.addWidget(self.rsult1le)
self.left_vbl.addWidget(self.instruction22_text)
self.left_vbl.addWidget(self.button_sits)
self.left_vbl.addWidget(self.instruction23_text)
self.left_vbl.addWidget(self.button_finaltest)
self.left_vbl.addWidget(self.result2le)
self.left_vbl.addWidget(self.result3le)
self.left_vbl.addWidget(self.button, alignment=Qt.AlignCenter)
self.right_vbl.addWidget(self.text_timer)

# Add vertical layouts to horizontal layout

# Set the main layout

def next_screen(self):
self.hide()
self.third_screen = ThirdWin()
self.third_screen.show()

def timer1(self):
global time
time = QTime(0, 0, 15)
self.timer = QTimer()
self.text_timer=QLabel(time.toString(‘hh:mm:ss’))
self.text_timer.setFont(QFont(‘times’, 36, QFont.Bold))
self.timer.timeout.connect(self.timer1Event)
self.timer.start(1000)

def timer1Event(self):
global time
time = time.addSecs(-1)
self.text_timer.setText(time.toString(‘hh:mm:ss’))
self.text_timer.setFont(QFont(‘Times’, 36, QFont.Bold))
self.text_timer.setStyleSheet(‘color: rgb(0, 0, 0)’)
if time.toString(‘hh:mm:ss’) == ‘00:00:00’:
self.timer.stop()

def timer2(self):
global time
time = QTime(0, 0, 30)
self.timer = QTimer()
self.text_timer = QLabel(time.toString(‘hh:mm:ss’)[6:8])
self.text_timer.setFont(QFont(‘times’, 36, QFont.Bold))
self.timer.timeout.connect(self.timer2Event)
self.timer.start(1500)

def timer2Event(self):
global time
time = time.addSecs(-1)
self.text_timer.setText(time.toString(‘hh:mm:ss’)[6:8])
self.text_timer.setFont(QFont(‘Times’, 36, QFont.Bold))
self.text_timer.setStyleSheet(‘color: rgb(0, 0, 0)’)
if time.toString(‘hh:mm:ss’) == ‘00:00:00’:
self.timer.stop()

def timer3(self):
global time
time = QTime(0, 1, 0)
self.timer = QTimer()
self.text_timer = QLabel(time.toString(‘hh:mm:ss’))
self.text_timer.setFont(QFont(‘times’, 36, QFont.Bold))
self.timer.timeout.connect(self.timer2Event)
self.timer.timeout.connect(self.timer3Event)
self.timer.start(1000)

def timer3Event(self):
global time
if int(time.toString(‘hh:mm:ss’)[6:8]) >= 45:
self.text_timer.setStyleSheet(‘color: rgb(0, 255, 0)’)
elif int(time.toString(‘hh:mm:ss’)[6:8]) <= 15:
self.text_timer.setStyleSheet(‘color: rgb(0, 255, 0)’)
else:
self.text_timer.setStyleSheet(‘color: rgb(0, 0, 0)’)

def connect(self):
self.button.clicked.connect(self.next_screen)
self.button_sits.clicked.connect(self.timer1)
self.button_finaltest.clicked.connect(self.timer2)
self.button_test.clicked.connect(self.timer3)
перепиши чтобы было правильный синтаксис