Python 3 Script to Capture Screenshot of FullScreen or Parts as PNG Image Using pyscreenshot Library Full Project For Beginners

 

 

pip install pyscreenshot

 

 

 

 

 

CAPTURING FULL SCREEN SCREENSHOT

 

 

app.py

 

 

# Program to take screenshot

import pyscreenshot

# To capture the screen
image = pyscreenshot.grab()

# To display the captured screenshot
image.show()

# To save the screenshot
image.save("image.png")

 

 

PARTS OF SCREEN

 

 

app.py

 

 

# Program for partial screenshot

import pyscreenshot

# im=pyscreenshot.grab(bbox=(x1,x2,y1,y2))
image = pyscreenshot.grab(bbox=(10, 10, 500, 500))

# To view the screenshot
image.show()

# To save the screenshot
image.save("image.png")

Leave a Reply