Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 77 for isopen (0.17 sec)

  1. scripts/playwright/separate_openapi_schemas/image01.py

        page.screenshot(
            path="docs/en/docs/img/tutorial/separate-openapi-schemas/image01.png"
        )
    
        # ---------------------
        context.close()
        browser.close()
    
    
    process = subprocess.Popen(
        ["uvicorn", "docs_src.separate_openapi_schemas.tutorial001:app"]
    )
    try:
        with sync_playwright() as playwright:
            run(playwright)
    finally:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 25 19:10:22 GMT 2023
    - 819 bytes
    - Viewed (0)
  2. docs/en/data/sponsors.yml

        title: Take code reviews from hours to minutes
        img: https://fastapi.tiangolo.com/img/sponsors/codacy.png
    bronze:
      - url: https://www.exoflare.com/open-source/?utm_source=FastAPI&utm_campaign=open_source
        title: Biosecurity risk assessments made easy.
        img: https://fastapi.tiangolo.com/img/sponsors/exoflare.png
      - url: https://testdriven.io/courses/tdd-fastapi/
    Others
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Mar 25 23:10:11 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  3. docs/zh/docs/advanced/events.md

    {!../../../docs_src/events/tutorial002.py!}
    ```
    
    此处,`shutdown` 事件处理器函数在 `log.txt` 中写入一行文本 `Application shutdown`。
    
    !!! info "说明"
    
        `open()` 函数中,`mode="a"` 指的是**追加**。因此这行文本会添加在文件已有内容之后,不会覆盖之前的内容。
    
    !!! tip "提示"
    
        注意,本例使用 Python `open()` 标准函数与文件交互。
    
        这个函数执行 I/O(输入/输出)操作,需要等待内容写进磁盘。
    
        但 `open()` 函数不支持使用 `async` 与 `await`。
    
        因此,声明事件处理函数要使用 `def`,不能使用 `asnyc def`。
    
    !!! info "说明"
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  4. docs/ko/docs/advanced/events.md

    이 예제에서 `shutdown` 이벤트 핸들러 함수는 `"Application shutdown"`이라는 텍스트가 적힌 `log.txt` 파일을 추가할 것입니다.
    
    !!! info "정보"
        `open()` 함수에서 `mode="a"`는 "추가"를 의미합니다. 따라서 이미 존재하는 파일의 내용을 덮어쓰지 않고 새로운 줄을 추가합니다.
    
    !!! tip "팁"
        이 예제에서는 파일과 상호작용 하기 위해 파이썬 표준 함수인 `open()`을 사용하고 있습니다.
    
        따라서 디스크에 데이터를 쓰기 위해 "대기"가 필요한 I/O (입력/출력) 작업을 수행합니다.
    
        그러나 `open()`은 `async`와 `await`을 사용하지 않기 때문에 이벤트 핸들러 함수는 `async def`가 아닌 표준 `def`로 선언하고 있습니다.
    
    !!! info "정보"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 22:35:55 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_request_files/test_tutorial003_an_py39.py

        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
        path2 = tmp_path / "test2.txt"
        path2.write_bytes(b"<file content2>")
    
        client = TestClient(app)
        with path.open("rb") as file, path2.open("rb") as file2:
            response = client.post(
                "/files/",
                files=(
                    ("files", ("test.txt", file)),
                    ("files", ("test2.txt", file2)),
                ),
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 7.6K bytes
    - Viewed (0)
  6. docs/en/docs/advanced/events.md

    ```Python hl_lines="1  13"
    {!../../../docs_src/events/tutorial003.py!}
    ```
    
    A **context manager** in Python is something that you can use in a `with` statement, for example, `open()` can be used as a context manager:
    
    ```Python
    with open("file.txt") as file:
        file.read()
    ```
    
    In recent versions of Python, there's also an **async context manager**. You would use it with `async with`:
    
    ```Python
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_request_files/test_tutorial001_an.py

                    }
                ]
            }
        )
    
    
    def test_post_file(tmp_path):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
    
        client = TestClient(app)
        with path.open("rb") as file:
            response = client.post("/files/", files={"file": file})
        assert response.status_code == 200, response.text
        assert response.json() == {"file_size": 14}
    
    
    def test_post_large_file(tmp_path):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  8. docs/en/docs/how-to/configure-swagger-ui.md

    # Configure Swagger UI
    
    You can configure some extra <a href="https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration" class="external-link" target="_blank">Swagger UI parameters</a>.
    
    To configure them, pass the `swagger_ui_parameters` argument when creating the `FastAPI()` app object or to the `get_swagger_ui_html()` function.
    
    `swagger_ui_parameters` receives a dictionary with the configurations passed to Swagger UI directly.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py

        patha = tmp_path / "test.txt"
        pathb = tmp_path / "testb.txt"
        patha.write_text("<file content>")
        pathb.write_text("<file b content>")
    
        client = TestClient(app)
        with patha.open("rb") as filea, pathb.open("rb") as fileb:
            response = client.post(
                "/files/",
                data={"token": "foo"},
                files={"file": filea, "fileb": ("testb.txt", fileb, "text/plain")},
            )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_background_tasks/test_tutorial001.py

        response = client.post("/send-notification/******@****.***")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Notification sent in the background"}
        with open("./log.txt") as f:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 578 bytes
    - Viewed (0)
Back to top