Python does not force you to use OOP like e.g. Java or C#, so you don't need to put stuff into classes if there is no real benefit from that for you.
Especially creating a class instance just to group stuff is not the best way to go IMHO. You could extract that stuff into a module instead. This does not require any instances, it just needs to be imported. That way it's also in a separated file and namespace.
Example:
main.py:
if __name__ == "__main__":
import sys
args = sys.argv[1:]
if len(args) != 2:
print("This script requires exactly two command-line arguments!")
exit(1)
import my_module
exit_code = my_module.run(args) or 0
exit(exit_code)
else:
raise ImportError("Run this file directly, don't import it!")
my_module.py:
# initialization code to be run at import time goes here
def run(args):
# do whatever you need to do
print("Hello world!")
print("You said <", args[0], "> and <", args[1], ">."
# you may return an integer (1-255) as exit code if an error occurred,
# else the default exit code is 0 (successful; no error)
However, don't take this approach as ultimate truth! It's my personal, (not so) humble opinion, but there are always some situations where one approach fits better, and some where others should be preferred.
Also this is mainly a design question and has no real impact on the stability or functionality of your programs. It may only improve the readability, but especially for small scripts it's not a good approach as it adds a lot of code that doesn't really do anything. It's only useful if you have a large project with several modules, I'd say.
For rather small scripts (single file or only very few modules) I would recommend to just define all classes and functions you need at the top and then use the standard if __name__ == "__main__" as entry point.
if __name__ ...line is wrong, it must be at the outer level. Probably just a typo?