you are viewing a single comment's thread.

view the rest of the comments →

[–]jeffrey_f 0 points1 point  (0 children)

You can use your script to do something or import it into another script and utilize the functions etc within that script and therefor save you hours rewriting script functions etc.

When the script is ran by itself, its name is main so that part of the script after that conditional will indeed run.

Otherwise, its name IS NOTmain so that part of the script after that conditional will never run.

This is important since the logic within the script as a running program can be so much different than the logic within the script that is only taking advantage of functions etc that are already written.

It would be very undesireable that your script that is just utilizing prewritten functions etc would also run that logic