Created
February 18, 2017 17:56
-
-
Save slarson/21c6008202581b92c6d292b7ea45d682 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyvirtualdisplay import Display | |
xephyr=Display(visible=1, size=(320, 240)).start() | |
from easyprocess import EasyProcess | |
from pyvirtualdisplay.smartdisplay import SmartDisplay | |
with SmartDisplay(visible=0, bgcolor='black') as disp: | |
with EasyProcess('gxmessage hello'): | |
img = disp.waitgrab() | |
img.save('screenshot.png') | |
//alternatively: | |
from easyprocess import EasyProcess | |
from pyvirtualdisplay.smartdisplay import SmartDisplay | |
with SmartDisplay(visible=0, bgcolor='black') as disp: | |
with EasyProcess('pynml examples/LEMS_c302_C2_MotorToMuscleSynTest.xml') as proc: | |
proc.sleep(10).stop() | |
img = disp.waitgrab(timeout=300) | |
img.save('screenshot.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment