Python Pillow and PSUtil doesnot work with OSMC

I am trying to display an image and then close the image viewer using python script that uses Pillow and PSUtil. It works fine on ubuntu, but it doesnot run on the latest osmc.
Can you please suggest/point out what I am doing wrong. Below is a small script that I ran on ubuntu.

#!/usr/bin/python
import time

import psutil
from PIL import Image

# open and show image
im = Image.open('test.png')
im.show()

# display image for 10 seconds
time.sleep(10)

# hide image
for proc in psutil.process_iter():
    if proc.name() == "display":
        proc.kill()

I assume this would require an X Server to display the image, or?

Triggering an addon ?Is it possible by python ?

You mean triggering a Kodi addon via python? For sure it’s possible
http://kodi.wiki/view/Python_development