Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 43 for __name__ (0.06 seconds)

  1. docs/zh-hant/docs/tutorial/debugging.md

    你可以在編輯器中連接偵錯器,例如 Visual Studio Code 或 PyCharm。
    
    ## 呼叫 `uvicorn` { #call-uvicorn }
    
    在你的 FastAPI 應用程式中,直接匯入並執行 `uvicorn`:
    
    {* ../../docs_src/debugging/tutorial001_py310.py hl[1,15] *}
    
    ### 關於 `__name__ == "__main__"` { #about-name-main }
    
    `__name__ == "__main__"` 的主要目的是,當你的檔案以以下方式呼叫時,執行某些程式碼:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    但當其他檔案匯入它時不會執行,例如:
    
    ```Python
    from myapp import app
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 2.4K bytes
    - Click Count (0)
  2. docs/en/docs/tutorial/debugging.md

    ## Call `uvicorn` { #call-uvicorn }
    
    In your FastAPI application, import and run `uvicorn` directly:
    
    {* ../../docs_src/debugging/tutorial001_py310.py hl[1,15] *}
    
    ### About `__name__ == "__main__"` { #about-name-main }
    
    The main purpose of the `__name__ == "__main__"` is to have some code that is executed when your file is called with:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 2.4K bytes
    - Click Count (0)
  3. docs/zh/docs/tutorial/debugging.md

    你可以在编辑器中连接调试器,例如使用 Visual Studio Code 或 PyCharm。
    
    ## 调用 `uvicorn` { #call-uvicorn }
    
    在你的 FastAPI 应用中直接导入 `uvicorn` 并运行:
    
    {* ../../docs_src/debugging/tutorial001_py310.py hl[1,15] *}
    
    ### 关于 `__name__ == "__main__"` { #about-name-main }
    
    `__name__ == "__main__"` 的主要目的是使用以下代码调用文件时执行一些代码:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    而当其它文件导入它时并不会被调用,像这样:
    
    ```Python
    from myapp import app
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 2.4K bytes
    - Click Count (0)
  4. docs/ja/docs/tutorial/debugging.md

    ## `uvicorn` を呼び出す { #call-uvicorn }
    
    FastAPIアプリケーション上で、`uvicorn` を直接インポートして実行します:
    
    {* ../../docs_src/debugging/tutorial001_py310.py hl[1,15] *}
    
    ### `__name__ == "__main__"` について { #about-name-main }
    
    `__name__ == "__main__"` の主な目的は、ファイルが次のコマンドで呼び出されたときに実行されるコードを用意することです:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    ただし、次のように、別のファイルからインポートされるときには呼び出されません:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 3.1K bytes
    - Click Count (0)
  5. docs/ko/docs/tutorial/debugging.md

    ## `uvicorn` 호출 { #call-uvicorn }
    
    FastAPI 애플리케이션에서 `uvicorn`을 직접 임포트하여 실행합니다:
    
    {* ../../docs_src/debugging/tutorial001_py310.py hl[1,15] *}
    
    ### `__name__ == "__main__"` 에 대하여 { #about-name-main }
    
    `__name__ == "__main__"`의 주요 목적은 다음과 같이 파일이 호출될 때 실행되는 일부 코드를 갖는 것입니다.
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    그러나 다음과 같이 다른 파일을 가져올 때는 호출되지 않습니다.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 2.8K bytes
    - Click Count (0)
  6. tensorflow/api_template.__init__.py

    # the __path__ so that "from tensorflow.foo import bar" works.
    # We're using bitwise, but there's nothing special about that.
    _API_MODULE = _sys.modules[__name__].bitwise
    _tf_api_dir = _os.path.dirname(_os.path.dirname(_API_MODULE.__file__))
    _current_module = _sys.modules[__name__]
    
    if not hasattr(_current_module, "__path__"):
      __path__ = [_tf_api_dir]
    elif _tf_api_dir not in __path__:
      __path__.append(_tf_api_dir)
    
    Created: Tue Apr 07 12:39:13 GMT 2026
    - Last Modified: Wed Oct 02 22:16:02 GMT 2024
    - 6.8K bytes
    - Click Count (0)
  7. fastapi/security/http.py

            description: str | None = None,
            auto_error: bool = True,
        ):
            self.model = HTTPBaseModel(scheme=scheme, description=description)
            self.scheme_name = scheme_name or self.__class__.__name__
            self.auto_error = auto_error
    
        def make_authenticate_headers(self) -> dict[str, str]:
            return {"WWW-Authenticate": f"{self.model.scheme.title()}"}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Mar 16 10:16:48 GMT 2026
    - 13.1K bytes
    - Click Count (0)
  8. docs_src/wsgi/tutorial001_py310.py

    from a2wsgi import WSGIMiddleware
    from fastapi import FastAPI
    from flask import Flask, request
    from markupsafe import escape
    
    flask_app = Flask(__name__)
    
    
    @flask_app.route("/")
    def flask_main():
        name = request.args.get("name", "World")
        return f"Hello, {escape(name)} from Flask!"
    
    
    app = FastAPI()
    
    
    @app.get("/v2")
    def read_main():
        return {"message": "Hello World"}
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 426 bytes
    - Click Count (0)
  9. docs_src/debugging/tutorial001_py310.py

    import uvicorn
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def root():
        a = "a"
        b = "b" + a
        return {"hello world": b}
    
    
    if __name__ == "__main__":
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 223 bytes
    - Click Count (0)
  10. docs/lambda/README.md

    Install the necessary dependencies.
    ```sh
    pip install flask requests
    ```
    
    Following is an example lambda handler.
    ```py
    from flask import Flask, request, abort, make_response
    import requests
    
    app = Flask(__name__)
    @app.route('/', methods=['POST'])
    def get_webhook():
    	if request.method == 'POST':
    		# obtain the request event from the 'POST' call
    		event = request.json
    
    		object_context = event["getObjectContext"]
    
    Created: Sun Apr 05 19:28:12 GMT 2026
    - Last Modified: Tue Aug 12 18:20:36 GMT 2025
    - 7.7K bytes
    - Click Count (0)
Back to Top