Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 53 for print (0.14 sec)

  1. docs_src/dependencies/tutorial008c_an.py

    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("Oops, we didn't raise again, Britney ๐Ÿ˜ฑ")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
            raise InternalError(
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 710 bytes
    - Viewed (0)
  2. docs/em/docs/tutorial/handling-errors.md

    ```Python hl_lines="2-5  15  21"
    {!../../../docs_src/handling_errors/tutorial006.py!}
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.3K bytes
    - Viewed (0)
  3. docs/ja/docs/tutorial/handling-errors.md

    ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใฎไพ‹ๅค–ใƒใƒณใƒ‰ใƒฉใ‚’`fastapi.exception_handlers`ใ‹ใ‚‰ใ‚คใƒณใƒใƒผใƒˆใ—ใฆๅ†ๅˆฉ็”จใ™ใ‚‹ใ“ใจใŒใงใใพใ™:
    
    ```Python hl_lines="2 3 4 5 15 21"
    {!../../../docs_src/handling_errors/tutorial006.py!}
    ```
    
    ใ“ใฎไพ‹ใงใฏใ€้žๅธธใซ่กจ็พๅŠ›ใฎใ‚ใ‚‹ใƒกใƒƒใ‚ปใƒผใ‚ธใงใ‚จใƒฉใƒผใ‚’`print`ใ—ใฆใ„ใพใ™ใ€‚
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.8K bytes
    - Viewed (0)
  4. docs_src/dependencies/tutorial008d.py

    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("We don't swallow the internal error here, we raise again ๐Ÿ˜Ž")
            raise
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: str = Depends(get_username)):
        if item_id == "portal-gun":
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 694 bytes
    - Viewed (0)
  5. docs_src/dependencies/tutorial008d_an.py

    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("We don't swallow the internal error here, we raise again ๐Ÿ˜Ž")
            raise
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 744 bytes
    - Viewed (0)
  6. docs_src/dependencies/tutorial008d_an_py39.py

    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("We don't swallow the internal error here, we raise again ๐Ÿ˜Ž")
            raise
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 734 bytes
    - Viewed (0)
  7. docs/em/docs/tutorial/dependencies/dependencies-with-yield.md

    ```Python
    with open("./somefile.txt") as f:
        contents = f.read()
        print(contents)
    ```
    
    ๐Ÿ”˜, `open("./somefile.txt")` โœ ๐ŸŽš ๐Ÿ‘ˆ ๐Ÿค™ "๐Ÿ”‘ ๐Ÿ‘จโ€๐Ÿ’ผ".
    
    ๐Ÿ•โ” `with` ๐Ÿซ ๐Ÿ, โšซ๏ธ โš’ ๐Ÿ’ญ ๐Ÿ” ๐Ÿ“, ๐Ÿšฅ ๐Ÿ“ค โš .
    
    ๐Ÿ•โ” ๐Ÿ‘† โœ ๐Ÿ”— โฎ๏ธ `yield`, **FastAPI** ๐Ÿ”œ ๐Ÿ”˜ ๐Ÿ—œ โšซ๏ธ ๐Ÿ”‘ ๐Ÿ‘จโ€๐Ÿ’ผ, & ๐ŸŒ€ โšซ๏ธ โฎ๏ธ ๐ŸŽ ๐Ÿ”— ๐Ÿงฐ.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  8. docs_src/dependencies/tutorial008c.py

    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("Oops, we didn't raise again, Britney ๐Ÿ˜ฑ")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: str = Depends(get_username)):
        if item_id == "portal-gun":
            raise InternalError(
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 660 bytes
    - Viewed (0)
  9. scripts/docs.py

        ),
    ) -> None:
        """
        Build the docs for a language.
        """
        insiders_env_file = os.environ.get("INSIDERS_FILE")
        print(f"Insiders file {insiders_env_file}")
        if is_mkdocs_insiders():
            print("Using insiders")
        lang_path: Path = Path("docs") / lang
        if not lang_path.is_dir():
            typer.echo(f"The language translation doesn't seem to exist yet: {lang}")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Jan 22 19:26:14 GMT 2024
    - 10.9K bytes
    - Viewed (1)
  10. docs_src/dependencies/tutorial008c_an_py39.py

    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("Oops, we didn't raise again, Britney ๐Ÿ˜ฑ")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
            raise InternalError(
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 700 bytes
    - Viewed (0)
Back to top