Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 60 for Sprintf (0.2 sec)

  1. docs_src/python_types/tutorial009c_py310.py

    def say_hi(name: str | None):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 56 bytes
    - Viewed (0)
  2. 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)
  3. docs_src/extra_models/tutorial002.py

        return "supersecret" + raw_password
    
    
    def fake_save_user(user_in: UserIn):
        hashed_password = fake_password_hasher(user_in.password)
        user_in_db = UserInDB(**user_in.dict(), hashed_password=hashed_password)
        print("User saved! ..not really")
        return user_in_db
    
    
    @app.post("/user/", response_model=UserOut)
    async def create_user(user_in: UserIn):
        user_saved = fake_save_user(user_in)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 824 bytes
    - Viewed (0)
  4. 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)
  5. docs/em/docs/advanced/settings.md

        </div>
    
    ### โœ ๐Ÿ‡จ๐Ÿ‡ป {๐Ÿ
    
    ๐Ÿ‘† ๐Ÿ’ช โœ ๐ŸŒ ๐Ÿ”ข ๐Ÿž ๐Ÿ, ๐Ÿ“ถ (โš–๏ธ โฎ๏ธ ๐Ÿ™† ๐ŸŽ ๐Ÿ‘ฉโ€๐Ÿ”ฌ), &amp; โคด๏ธ โœ ๐Ÿ‘ซ ๐Ÿ.
    
    ๐Ÿ–ผ ๐Ÿ‘† ๐Ÿ’ช โœ”๏ธ ๐Ÿ“ `main.py` โฎ๏ธ:
    
    ```Python hl_lines="3"
    import os
    
    name = os.getenv("MY_NAME", "World")
    print(f"Hello {name} from Python")
    ```
    
    !!! tip
        ๐Ÿฅˆ โŒ <a href="https://docs.python.org/3.8/library/os.html#os.getenv" class="external-link" target="_blank">`os.getenv()`</a> ๐Ÿ”ข ๐Ÿ’ฒ ๐Ÿ“จ.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  6. docs_src/python_types/tutorial009.py

    from typing import Optional
    
    
    def say_hi(name: Optional[str] = None):
        if name is not None:
            print(f"Hey {name}!")
        else:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 12 21:44:23 GMT 2020
    - 164 bytes
    - Viewed (0)
  7. docs_src/python_types/tutorial008b.py

    from typing import Union
    
    
    def process_item(item: Union[int, str]):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 84 bytes
    - Viewed (0)
  8. docs_src/python_types/tutorial002.py

    def get_full_name(first_name: str, last_name: str):
        full_name = first_name.title() + " " + last_name.title()
        return full_name
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 172 bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top