示例#1
0
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)
示例#2
0
# 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)
示例#3
0
import bar as foo

foo.f()
示例#4
0
import bar
bar.f(1,
      2,
      3)
示例#5
0
import bar
bar.f(1, 2, 3)