Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 为什么不';不能连接?_Python 3.x_Sqlite_Pyqt5_Qpushbutton - Fatal编程技术网

Python 3.x 为什么不';不能连接?

Python 3.x 为什么不';不能连接?,python-3.x,sqlite,pyqt5,qpushbutton,Python 3.x,Sqlite,Pyqt5,Qpushbutton,当我关闭窗口时,按钮无法连接 当第一扇窗户关上的时候,我想把它打开 但是按钮不能连接 这是test.py import sys import sqlite3 from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QMainWindow from easter import Ui_Form from window_3 import App_2 class App(QMainWindow): def __init__(self)

当我关闭窗口时,按钮无法连接 当第一扇窗户关上的时候,我想把它打开 但是按钮不能连接

这是test.py

import sys
import sqlite3
from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QMainWindow
from easter import Ui_Form
from window_3 import App_2
class App(QMainWindow):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("Test")
        self.show()

    def closeEvent(self, event):
        Example().__init__()



class Example(QMainWindow, Ui_Form):
    def __init__(self):
        super().__init__()
        self.setupUi(self)
        # It is don't working
        self.buttonGroup.buttonClicked.connect(self.add)
        self.show()

    def add(self, sender):
        # It doesn't matter 
        con = sqlite3.connect("top.db")
        cur = con.cursor()
        idd = list(cur.execute("select id from Top").fetchall())
        a = cur.execute('update top set score = ? where id = ?', (int(sender.text()), idd[-1][0]))
        con.commit()

        App_2().__init__()
        self.close()

我可以添加一个window-3.py和easter.py我不明白你想做什么。但是,我可以看到您以错误的方式执行此操作(为什么调用
Example()。\uuu init\uuu()
?为什么调用两个
QMainWindow
?)。你们能解释一下你们想要达到的目标吗?因为,若我写了一个例子,并显示它是自动关闭的