screenshot

The command to take a screenshot of the current window.

Syntax

py.screenshot(filename: str) -> None

Usage

correct usage
# saves the screenshot to the current working directory
py.screenshot("ss.png")

---or---

# saves the screenshot using the filepath
py.screenshot("../images/ss.png")
incorrect usage
# Errors, include the file extension like '.png'
py.screenshot("ss")

---or---

# Errors, .screenshot() yields None
py.screenshot("ss.png").get("a")

Arguments

  • filename (str) - The filename including the path to the directory you want to save it in

Make sure to include the file extension like .png

Yields

  • None

Last updated