Rewrite main.py

Mekire on reddit told me there’s no need for a class here, so I rewrote
it as a plain function. Added if __name__ == "__main__": because I
learn from Kent D. Lee on YouTube that it is very Pythonic.