Submit
Path:
~
/
/
opt
/
cloudlinux
/
venv
/
lib64
/
python3.11
/
site-packages
/
pyvirtualdisplay
/
examples
/
File Content:
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")
Submit
FILE
FOLDER
Name
Size
Permission
Action
__pycache__
---
0755
__init__.py
0 bytes
0644
headless.py
245 bytes
0644
lowres.py
266 bytes
0644
nested.py
736 bytes
0644
screenshot.py
589 bytes
0644
threadsafe.py
772 bytes
0644
vncserver.py
284 bytes
0644
N4ST4R_ID | Naxtarrr