import sys
import os
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtWidgets import QApplication, QMainWindow, QLineEdit ,QWidget,QGridLayout,QPushButton,QLabel,QTextBrowser,QDesktopWidget
from PyQt5.QtGui import *
from PyQt5 import QtCore
from PyQt5.QtCore import Qt
#a simple GUI sample
class mainwin(QWidget):
def __init__(self,parent=None):
super(mainwin,self).__init__(parent)
self.main()
def main(self):
self.setWindowTitle('MAIN')
self.label=QLabel(self)
self.label.setText('MainWindow')
self.label.setFont(QFont('Arial',15))
self.resize(300,150)
if __name__=='__main__':
app = QApplication(sys.argv)
win=mainwin()
print('launched')
win.show()
sys.exit(app.exec())
when i run a pyqt code in the build-in code builder. the origin will shut down with the code.
I assume it's the 'sys.exit(app.exec())' that trying to close everything?
is there any other way to only close pyqt without affect origin?
Thanks!!