1''' 2using :keyword:`with` statement 3''' 4from easyprocess import EasyProcess 5from pyvirtualdisplay.smartdisplay import SmartDisplay 6 7if __name__ == "__main__": 8 with SmartDisplay(visible=0, bgcolor='black') as disp: 9 with EasyProcess('xmessage hello'): 10 img = disp.waitgrab() 11 12 13 img.show() 14