def main(req: func.HttpRequest) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.') name = bar.f() if name: return func.HttpResponse(f"Hello {name}!") else: return func.HttpResponse( "Please pass a name on the query string or in the request body", status_code=400)
# Python's module system # A python file can be used as a module and creates # a namespace. A namespace is a name for a set of # names import bar from bar import name # from bar import * # BAD!!!! if __name__ == "__main__": bar.f() print(bar.name) print(name)
import bar as foo foo.f()
import bar bar.f(1, 2, 3)