Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

make screen shot of specific part of screen python

import mss
import mss.tools


with mss.mss() as sct:
    # The screen part to capture
    monitor = {"top": 160, "left": 160, "width": 160, "height": 135}
    output = "sct-{top}x{left}_{width}x{height}.png".format(**monitor)

    # Grab the data
    sct_img = sct.grab(monitor)

    # Save to the picture file
    mss.tools.to_png(sct_img.rgb, sct_img.size, output=output)
    print(output)
Comment

PREVIOUS NEXT
Code Example
Python :: plot size 
Python :: matplotlib bar label 
Python :: python regex tester 
Python :: find substr within a str in python 
Python :: pymongo [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate 
Python :: python split list into n sublists 
Python :: python column multiply 
Python :: python docstring example 
Python :: print in binary python 
Python :: pip install streamlit 
Python :: sieve of eratosthenes python 
Python :: copy string python 
Python :: pytest multi thread 
Python :: select multiple columns in pandas dataframe 
Python :: how to add rows to empty dataframe 
Python :: python dict append 
Python :: from array to tuple python 
Python :: exit python terminal 
Python :: work with gzip 
Python :: django unique together 
Python :: python get memory address 
Python :: return count of substring in a string 
Python :: read a csv and plot in python 
Python :: check integer number python 
Python :: number of unique pairs in columns pandas 
Python :: pattern program in python 
Python :: multiclass ROC AUC curve 
Python :: sort a list of array python 
Python :: python logging into two different files 
Python :: 1d array to one hot 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =