Python main call within class
Well, first, you need to actually define a function before you can run it (and it doesn’t need to be called main). For instance: class Example(object): def run(self): print “Hello, world!” if __name__ == ‘__main__’: Example().run() You don’t need to use a class, though – if all you want to do is run some code, … Read more