Hello and good question.
Just by "being use to" main() functions, many Python programmer with former experience in C++, Java, and C# love to use def name = "main" for of some sort. While "old school" programmers like this, Python is a very versitile, free form programming (actually it is a scripting language) what it does not need a main function.
If you were to make a basic calculator program, you can just make a function called "calc", and Python will be happy. I have made a GUI Vector Calculator w/o a "main" function, so there is Zero need.
def calc(x, y):
sum = x + y
return sum
main()
function so much as theif __name__ == '__main__'
guard that provides most of the value discussed in those posts, and that in turn centers around being able toimport
stuff from your scripts. If you put your other functions insidemain()
, you are losing exactly that value. – Detroit