File "c:/Users/╩ышь/Desktop/hearttest/screen1.py", line 35, in nextscreen…
- User
File "c:/Users/╩ышь/Desktop/hearttest/screen1.py", line 35, in next_screen self.second_screen = SecondWin()
- Assistant
As an AI language model, I am unable to see what's in your code, but from the error message you provided, it seems like there is an issue creating an instance of the
SecondWinclass. It could be that the class is not defined or there is a typo in the class name. Another possibility is that there is an error in the__init__method of theSecondWinclass that is preventing it from being instantiated. You may want to double-check your code and ensure that everything is correctly defined and implemented before running it. - User
from PyQt5.QtCore import Qt, QTime ,QTimer from PyQt5.QtWidgets import * from screen2 import * from screen3 import *
app = QApplication([])
class MainWin(QWidget): def init(self): super().init() self.look() self.initUI() self.connect()
def look(self): self.setWindowTitle('1st screen') self.resize(600,400) def initUI(self): self.main_layout = QVBoxLayout() self.hello_text = QLabel('Hello\nhello\nhello') self.instruction_text = QLabel('Long text') self.button = QPushButton('Start') self.main_layout.addWidget(self.hello_text) self.main_layout.addWidget(self.instruction_text) self.main_layout.addWidget(self.button, alignment=Qt.AlignCenter) self.setLayout(self.main_layout) def connect(self): self.button.clicked.connect(self.next_screen) def next_screen(self): self.hide() self.second_screen = SecondWin() self.second_screen.show()main_win = MainWin() main_win.show() app.exec_()
- Assistant
The code seems fine, as the error message you provided in your previous message is not present anymore after importing the required modules from
screen2andscreen3.However, there are no specifics provided regarding the nature of the issue you are experiencing. Therefore, I suggest you run the code and see if it works as intended. If you encounter an error or bug, provide a specific description of the issue, including any error messages or debugging information, so that we can help you better.
- User
Traceback (most recent call last): File "c:/Users/╩ышь/Desktop/hearttest/screen1.py", line 35, in next_screen self.second_screen = SecondWin() File "c:\Users\╩ышь\Desktop\hearttest\screen2.py", line 13, in init self.connect() File "c:\Users\╩ышь\Desktop\hearttest\screen2.py", line 114, in connect self.button_sits.clicken.connect(self.timer1) AttributeError: 'QPushButton' object has no attribute 'clicken'
- Assistant
It looks like there is a typo in your code.
The error message is telling you that the
clickensignal is called on aQPushButtonobject, which does not exist. Instead, it should beclicked, so you should correct it as follows:self.button_sits.clicked.connect(self.timer1)After making that change, the button should be connected to the
timer1method as expected. - User
- Assistant
- User
теперь на втором экране ничего не выводится
- Assistant
- User
не помогла виджетов нету
- Assistant
I'm sorry that the previous solution didn't work.
You might need to go through your code again to see if there are any other issues that could result in the widgets not being properly displayed.
Here are some possible solutions you could try:
- Add the `
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.