

The global variable instead of a local name. This isĮrror-prone as other functions within the module could be unintentionally using

The phrase variable would be global to the entire module. Note that if the module didn’t encapsulate code inside the main functionīut instead put it directly within the if _name_ = '_main_' block, exit ( main ()) # next section explains the use of sys.exit argv ) echo ( phrase ) return 0 if _name_ = '_main_' : sys. # echo.py import shlex import sys def echo ( phrase : str ) -> None : """A dummy wrapper around print.""" # for demonstration purposes, you can imagine that there is some # valuable and reusable logic inside this function print ( phrase ) def main () -> int : """Echo the input arguments to standard output""" phrase = shlex.
