I am learning python.I am new to it.
http://zetcode.com/gui/pyqt4/firstprograms/
from this website, I need help understanding the code.
#import sys
from PyQt4 import QtGui
def main():
app = QtGui.QApplication(sys.argv)
w = QtGui.QWidget()
w.resize(250, 150)
w.move(300, 300)
w.setWindowTitle('Simple')
w.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
#
My question is below
app = QtGui.QApplication(sys.argv)
in the code, app variable seems actually used. so why does it have to assign? and what is purpose of it? for me, w seems window object...I am confused..
if __name__ == '__main__':
main()
where __name__ and __main__ comes from?
what is the functionality of this if statement?