Skip to main content

pyvirtualdisplay is a python wrapper for Xvfb, Xephyr and Xvnc

Links:
Features:
Known problems:
  • Python 3 is not supported

  • only a few backend options are supported

Possible applications:
  • GUI testing

  • automatic GUI screenshot

Basic usages

Start Xephyr:

from pyvirtualdisplay import Display
xephyr=Display(visible=1, size=(320, 240)).start()

Create screenshot of xmessage with Xvfb:

from easyprocess import EasyProcess
from pyvirtualdisplay.smartdisplay import SmartDisplay
with SmartDisplay(visible=0, bgcolor='black') as disp:
    with EasyProcess('xmessage hello'):
        img = disp.waitgrab()
img.show()

Installation

General

  • install Xvfb or Xephyr or Xvnc.

  • install pip

  • optional: pyscreenshot and PIL should be installed for smartdisplay submodule

  • install the program:

    # as root
    pip install pyvirtualdisplay

Ubuntu

sudo apt-get install python-pip
sudo apt-get install xvfb
sudo apt-get install xserver-xephyr
sudo apt-get install tightvncserver
sudo pip install pyvirtualdisplay
# optional
sudo apt-get install python-imaging
sudo apt-get install scrot
sudo pip install pyscreenshot

Uninstall

# as root
pip uninstall pyvirtualdisplay

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyVirtualDisplay-0.0.9.tar.gz (38.2 kB view details)

Uploaded Source

File details

Details for the file PyVirtualDisplay-0.0.9.tar.gz.

File metadata

File hashes

Hashes for PyVirtualDisplay-0.0.9.tar.gz
Algorithm Hash digest
SHA256 95441c04261cc71185052d01e22376ba3034c1dd207efb0cf7bd11c7587ea136
MD5 e437b804486a4a433fc978f977203a90
BLAKE2b-256 a9507b495fb23f029516902dd1a79e08000f86a77af9a67fde8ce4283111628d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page