Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 36 for __name__ (0.2 sec)

  1. docs/ko/docs/tutorial/debugging.md

    ## `uvicorn` 호출
    
    FastAPI 애플리케이션에서 `uvicorn`을 직접 임포트하여 실행합니다
    
    ```Python hl_lines="1  15"
    {!../../../docs_src/debugging/tutorial001.py!}
    ```
    
    ### `__name__ == "__main__"` 에 대하여
    
    `__name__ == "__main__"`의 주요 목적은 다음과 같이 파일이 호출될 때 실행되는 일부 코드를 갖는 것입니다.
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    그러나 다음과 같이 다른 파일을 가져올 때는 호출되지 않습니다.
    
    ```Python
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 04:18:08 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  2. docs/ru/docs/tutorial/debugging.md

    ## Вызов `uvicorn`
    
    В вашем FastAPI приложении, импортируйте и вызовите `uvicorn` напрямую:
    
    ```Python hl_lines="1  15"
    {!../../../docs_src/debugging/tutorial001.py!}
    ```
    
    ### Описание `__name__ == "__main__"`
    
    Главная цель использования `__name__ == "__main__"` в том, чтобы код выполнялся при запуске файла с помощью:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  3. docs/fr/docs/tutorial/debugging.md

    Dans votre application FastAPI, importez et exécutez directement `uvicorn` :
    
    ```Python hl_lines="1  15"
    {!../../../docs_src/debugging/tutorial001.py!}
    ```
    
    ### À propos de `__name__ == "__main__"`
    
    Le but principal de `__name__ == "__main__"` est d'avoir du code qui est exécuté lorsque votre fichier est appelé avec :
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Mar 06 16:26:49 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  4. docs/zh/docs/tutorial/debugging.md

    你可以在编辑器中连接调试器,例如使用 Visual Studio Code 或 PyCharm。
    
    ## 调用 `uvicorn`
    
    在你的 FastAPI 应用中直接导入 `uvicorn` 并运行:
    
    ```Python hl_lines="1  15"
    {!../../../docs_src/debugging/tutorial001.py!}
    ```
    
    ### 关于 `__name__ == "__main__"`
    
    `__name__ == "__main__"` 的主要目的是使用以下代码调用文件时执行一些代码:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    而当其它文件导入它时并不会被调用,像这样:
    
    ```Python
    from myapp import app
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 27 17:51:51 GMT 2021
    - 2.4K bytes
    - Viewed (0)
  5. docs/em/docs/tutorial/debugging.md

    👆 💪 🔗 🕹 👆 👨‍🎨, 🖼 ⏮️ 🎙 🎙 📟 ⚖️ 🗒.
    
    ## 🤙 `uvicorn`
    
    👆 FastAPI 🈸, 🗄 &amp; 🏃 `uvicorn` 🔗:
    
    ```Python hl_lines="1  15"
    {!../../../docs_src/debugging/tutorial001.py!}
    ```
    
    ### 🔃 `__name__ == "__main__"`
    
    👑 🎯 `__name__ == "__main__"` ✔️ 📟 👈 🛠️ 🕐❔ 👆 📁 🤙 ⏮️:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    ✋️ 🚫 🤙 🕐❔ ➕1️⃣ 📁 🗄 ⚫️, 💖:
    
    ```Python
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/debugging.md

    ## Call `uvicorn`
    
    In your FastAPI application, import and run `uvicorn` directly:
    
    ```Python hl_lines="1  15"
    {!../../../docs_src/debugging/tutorial001.py!}
    ```
    
    ### 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>
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jun 22 17:04:16 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  7. docs/ja/docs/tutorial/debugging.md

    ## `uvicorn` の実行
    
    FastAPIアプリケーション上で、`uvicorn` を直接インポートして実行します:
    
    ```Python hl_lines="1  15"
    {!../../../docs_src/debugging/tutorial001.py!}
    ```
    
    ### `__name__ == "__main__"` について
    
    `__name__ == "__main__"` の主な目的は、ファイルが次のコマンドで呼び出されたときに実行されるコードを用意することです:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    ただし、次のように、別のファイルからインポートされるときには呼び出されません:
    
    ```Python
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Feb 07 17:25:31 GMT 2021
    - 3K bytes
    - Viewed (0)
  8. tests/test_generic_parameterless_depends.py

    
    class A:
        pass
    
    
    class B:
        pass
    
    
    @app.get("/a")
    async def a(dep: Dep[A]):
        return {"cls": dep.__class__.__name__}
    
    
    @app.get("/b")
    async def b(dep: Dep[B]):
        return {"cls": dep.__class__.__name__}
    
    
    client = TestClient(app)
    
    
    def test_generic_parameterless_depends():
        response = client.get("/a")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  9. fastapi/security/http.py

            description: Optional[str] = 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
    
        async def __call__(
            self, request: Request
        ) -> Optional[HTTPAuthorizationCredentials]:
            authorization = request.headers.get("Authorization")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 15:29:38 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  10. docs_src/debugging/tutorial001.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__":
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 223 bytes
    - Viewed (0)
Back to top