SyntaxFix
Write A Post
Hire A Developer
Questions
Another solution is to install Xvfb, and export your display to it. ie:
disp=:8 screen=0 geom=640x480x24 exec Xvfb $disp -screen $screen $geom 2>/tmp/Xvfb.log &
Then
$ export DISPLAY=:8
$ ./example.py