0

I am following a tutorial on wxPython and the tutorial shows the following code:

class Example(wx.Frame):

    def __init__(self, parent, title):
        super(Example, self).__init__(parent, title=title,
            size=(350, 250))


def main():

    app = wx.App()
    ex = Example(None, title='Sizing')
    ex.Show()
    app.MainLoop()


if __name__ == '__main__':
    main()

I am assuming

if __name__ == '__main__':
        main()

is how the main() method is called but I am not really sure. Can someone explain what this bit of code does?

user9708733
  • 113
  • 2
  • 7

0 Answers0