I read through a lot of the answers but can't figure out how to execute a command which I currently execute using cron from subprocess or something better?
# cron command
00 16 * * 1-5 DISPLAY=:10 /path/to/shell/script.sh > log/file.log 2>&1
The DISPLAY is Xvfb.
os.envto set the environment variable, then usesubprocess.Popen()to run the script.DISPLAY=:10is initiated. I tried checkingos.env()but got a >AttributeError: module 'os' has no attribute 'env'os.environ. Soos.environ['DISPLAY'] = ':10'