def main(): with SmartDisplay(size=(640, 480), visible=0) as disp: with EasyProcess('gnumeric'): # time.sleep(2) img = disp.waitgrab(timeout=60) rectangles = active_rectangles() print( rectangles ) img = draw_indexed_rect_list(img, rectangles) img = autocrop(img) # display results img.show()
def main(): with Display(): with EasyProcess('zenity --question') as p: p.sleep(1) img = grab() rectangles = discover_buttons() print( rectangles ) img = draw_indexed_rect_list(img, rectangles) img = autocrop(img) # display results img.show()