Skip to content

Commit

Permalink
added show arguement so user can determine wether he wants to see the…
Browse files Browse the repository at this point in the history
… image or not in take_screenshot
  • Loading branch information
ns696 committed Jan 3, 2022
1 parent b7f20b8 commit b89c294
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pywhatkit/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
from PIL import ImageGrab

def take_screenshot(
file_name: str = "pywhatkit_screenshot", delay: int = 2
file_name: str = "pywhatkit_screenshot", delay: int = 2, show:bool=True
) -> None:
"""Take Screenshot of the Screen"""

time.sleep(delay)
screen = ImageGrab.grab()
screen.show(title=file_name)
if show:
screen.show(title=file_name)
screen.save(f"{file_name}.png")


Expand Down

0 comments on commit b89c294

Please sign in to comment.