Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for __main__ (0.06 sec)

  1. docs/en/docs/tutorial/debugging.md

    ## Call `uvicorn` { #call-uvicorn }
    
    In your FastAPI application, import and run `uvicorn` directly:
    
    {* ../../docs_src/debugging/tutorial001_py39.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>
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 2.4K bytes
    - Viewed (0)
  2. docs/pt/docs/tutorial/debugging.md

    Em sua aplicação FastAPI, importe e execute `uvicorn` diretamente:
    
    {* ../../docs_src/debugging/tutorial001_py39.py hl[1,15] *}
    
    ### Sobre `__name__ == "__main__"` { #about-name-main }
    
    O objetivo principal de `__name__ == "__main__"` é ter algum código que seja executado quando seu arquivo for chamado com:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 2.7K bytes
    - Viewed (0)
  3. docs/de/docs/tutorial/debugging.md

    Importieren und führen Sie `uvicorn` direkt in Ihrer FastAPI-Anwendung aus:
    
    {* ../../docs_src/debugging/tutorial001_py39.py hl[1,15] *}
    
    ### Über `__name__ == "__main__"` { #about-name-main }
    
    Der Hauptzweck von `__name__ == "__main__"` ist, dass Code ausgeführt wird, wenn Ihre Datei mit folgendem Befehl aufgerufen wird:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 2.7K bytes
    - Viewed (0)
  4. docs/uk/docs/tutorial/debugging.md

    ## Виклик `uvicorn`
    
    У Вашому FastAPI-додатку імпортуйте та запустіть `uvicorn` безпосередньо:
    
    {* ../../docs_src/debugging/tutorial001.py hl[1,15] *}
    
    ### Про `__name__ == "__main__"`
    
    Головна мета використання `__name__ == "__main__"` — це забезпечення виконання певного коду тільки тоді, коли файл запускається безпосередньо:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Feb 28 14:24:45 UTC 2025
    - 3.6K bytes
    - Viewed (0)
  5. docs/ru/docs/tutorial/debugging.md

    В вашем FastAPI приложении, импортируйте и вызовите `uvicorn` напрямую:
    
    {* ../../docs_src/debugging/tutorial001_py39.py hl[1,15] *}
    
    ### Описание `__name__ == "__main__"` { #about-name-main }
    
    Главная цель использования `__name__ == "__main__"` в том, чтобы код выполнялся при запуске файла с помощью:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 3.9K bytes
    - Viewed (0)
  6. docs/es/docs/tutorial/debugging.md

    En tu aplicación de FastAPI, importa y ejecuta `uvicorn` directamente:
    
    {* ../../docs_src/debugging/tutorial001_py39.py hl[1,15] *}
    
    ### Acerca de `__name__ == "__main__"` { #about-name-main }
    
    El objetivo principal de `__name__ == "__main__"` es tener algo de código que se ejecute cuando tu archivo es llamado con:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 2.6K bytes
    - Viewed (0)
  7. docs_src/debugging/tutorial001_py39.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__":
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 223 bytes
    - Viewed (0)
  8. tests/test_tutorial/test_python_types/test_tutorial001_tutorial002.py

            "tutorial002_py39",
        ],
    )
    def test_run_module(module_name: str):
        with patch("builtins.print") as mock_print:
            runpy.run_module(f"docs_src.python_types.{module_name}", run_name="__main__")
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 398 bytes
    - Viewed (0)
  9. tests/test_tutorial/test_python_types/test_tutorial011.py

        ],
    )
    def test_run_module(module_name: str):
        with patch("builtins.print") as mock_print:
            runpy.run_module(f"docs_src.python_types.{module_name}", run_name="__main__")
    
        assert mock_print.call_count == 2
        call_args = [str(arg.args[0]) for arg in mock_print.call_args_list]
        assert call_args == [
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 691 bytes
    - Viewed (0)
  10. docs/fr/llm-prompt.md

            «««
            "Hello world"
            “Hello Universe”
            "He said: 'Hello'"
            "The module is `__main__`"
            »»»
    
        Result (French):
    
            «««
            «Hello world»
            «Hello Universe»
            «He said: 'Hello'»
            «The module is `__main__`»
            »»»
    
    ### Ellipsis
    
    1) Make sure there is a space between an ellipsis and a word following or preceding the ellipsis.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 10:41:43 UTC 2025
    - 4.1K bytes
    - Viewed (0)
Back to top