if __name__ == "__main__" is the part that runs when the script is run from (say) the command line using a command like python myscript.py.
*args allows you to give the function more arguments than are explicitly required in the function definition.