Executing a script from Kodi’s file manager

I have a Python script that turns on/off some lights via a Tellstick Znet.
I just got it to work using Putty and SSH.
I can execute it on my Raspberry from my laptop using Putty and it works fine.

But it doesn’t work when I try to run it from Kodi’s File manager.

I can run other Python scripts from the File manager though.

I’m guessing the “import os” has something to do with it.
I’m very very new to Python Smile

This doesn’t work:

Code:
#!/usr/bin/env python
import os
os.system("python TDTools_beta.py --off 33")

This works:

Code:
#!/usr/bin/env python
import subprocess
proc = subprocess.Popen(["curl", "https://maker.ifttt.com/trigger/Turn_off/with/key/nCimy2XdjJHAr0eufQEcvZo95udryY4b-ofcrsMnwW2"])