Difference between .py and .app script on Google App Engine
Question: According to [Google App Engine
doc](https://cloud.google.com/appengine/docs/python/config/appconfig#Python_app_yaml_Script_handlers),
the script handler can call three types of Python scripts to handle the
request match by the URL pattern.

> A script: directive can contain either a file path ending in .py (meaning
> that the script uses CGI), or a Python module path, with package names
> separated by dots (meaning that the script uses WSGI). The last component of
> a script: directive using a Python module path is the name of a global
> variable in the module: that variable must be a WSGI app, and is usually
> called app by convention.

What is the difference between these three types and their use cases?


Answer: > A `script:` directive can contain either a **file** path ending in `.py`
> (meaning that the script uses CGI), or a **Python module** path, with
> package names separated by dots (meaning that the script uses WSGI). The
> last component of a `script:` directive using a **Python module** path is
> the name of a global variable in the module: that variable must be a WSGI
> app, and is usually called `app` by convention.
>
> **Note** : just like for a Python `import` statement, each subdirectory that
> is a package must contain a file named `__init__.py`.

There are actually only two methods of referencing the Python script. First, a
**file** path, e.g., `/home/tsr/myscript.py`. Second, a **Python module**
path, e.g., `mypackage.mymodule`.

See [Python's documentation on
packages](https://docs.python.org/3/tutorial/modules.html#packages) for more
information.

