import Color_tracking import Area_tracking import sys from PyQt6.QtWidgets import QApplication, QWidget, QPushButton def quit_app(): sys.exit(app.quit()) def main1(): Color_tracking.main() def main2(): Area_tracking.main() app = QApplication(sys.argv) widget = QWidget() widget.resize(300, 200) button1 = QPushButton('自选单颜色追踪', widget) button1.move(50, 50) button1.clicked.connect(Color_tracking.main) button2 = QPushButton('自选区域颜色追踪', widget) button2.move(50, 100) button2.clicked.connect(Area_tracking.main) quit_button = QPushButton('退出', widget) quit_button.move(200, 50) quit_button.clicked.connect(quit_app) widget.show() sys.exit(app.exec())