OK, if this is out of python subject just ignore it .
I am beginning to understand strange "indented" philosophy of python syntax.
I even got where __main__ came from.
I picked this sample code and trying to understand the
purpose of QApplication and
WHY is it run in main function .
( I am not to happy with so many "mains" in the example. )
After "cut and paste" another function into the sample code it simply runs ONLY the "main" function.
I need to understand the purpose of QApplication before I venture to use classes instead
of functions only.
I am beginning to understand strange "indented" philosophy of python syntax.
I even got where __main__ came from.
I picked this sample code and trying to understand the
purpose of QApplication and
WHY is it run in main function .
( I am not to happy with so many "mains" in the example. )
After "cut and paste" another function into the sample code it simply runs ONLY the "main" function.
I need to understand the purpose of QApplication before I venture to use classes instead
of functions only.
import sys from PyQt5.QtWidgets import QApplication, QWidget # main function def main(): #?? app = QApplication(sys.argv) # build main window w = QWidget() w.resize(250, 150) w.move(300, 300) w.setWindowTitle('CAT BT KISS Main window ') w.show() #?? run QApplicatio app.exec_() # no exit #sys.exit(app.exec_()) # process application and exit # next function def function (): application = QApplication(sys.argv) w = QWidget() w.resize(650, 150) w.move(500, 500) w.setWindowTitle('CAT BT KISS Main (function) window ') w.show() #? application.exec_() #sys.exit(app.exec_()) # process application and exit # default __name__ if __name__ == '__main__': # process main() function()