golden hour
/opt/cloudlinux/venv/lib/python3.11/site-packages/pyvirtualdisplay/examples
⬆️ Go Up
Upload
File/Folder
Size
Actions
__init__.py
0 B
Del
OK
__pycache__
-
Del
OK
headless.py
245 B
Del
OK
lowres.py
266 B
Del
OK
nested.py
736 B
Del
OK
screenshot.py
589 B
Del
OK
threadsafe.py
772 B
Del
OK
vncserver.py
284 B
Del
OK
Edit: screenshot.py
"Create screenshot of xmessage in background using 'smartdisplay' submodule" from easyprocess import EasyProcess from pyvirtualdisplay.smartdisplay import SmartDisplay # 'SmartDisplay' instead of 'Display' # It has 'waitgrab()' method. # It has more dependencies than Display. with SmartDisplay() as disp: with EasyProcess(["xmessage", "hello"]): # wait until something is displayed on the virtual display (polling method) # and then take a fullscreen screenshot # and then crop it. Background is black. img = disp.waitgrab() img.save("xmessage.png")
Save