Open mgvel opened 2 years ago
What is the purpose of if __name__ == "__main__":
before creating the parser?
main function is the place where a python scripts starts it's execution.
There is no need to specify main
as default like in c/c++. But by manually invoking this main function, we can control the order of things in some cases. Here we are forcing the programs to take command lines arguments before proceeding with any other action in the script.
Understood sir, thank you