Comment Comment by el_programmador Another benefit is re-usability. If you want your program to be callable as module or script from elsewhere without going through the tedious shell functions, "def main()" is the only way to go. parent el_programmador 6 years ago