Trying to run a Python script from rules / Win8.1 / no effect

(C Poschenrieder) #1

Greetings -
I am building a basic OH2 application for later port to raspberry or tinkerforge red brick on my windows 8.1 machine. Most of it works fine. But when I try to run a python script, I can see no effect. This script is supposed to create the file “test.txt” in /conf/scripts. This is the rule code:

executeCommandLine('D:\\openhab2\\conf\\scripts\\python.exe D:\\openhab2\\conf\\scripts\\test.py', 5000)

openhab.log says:

...[lipse.smarthome.io.net.exec.ExecUtil] - executed commandLine 'D:\openhab2\conf\scripts\python.exe D:\openhab2\conf\scripts\test.py'

I thought it might be a rights issue, started start.bat as Admin, but same as before. Also tried various slash/backslash combinations, with and withput timeout, I tried cmd.exe, …
Any hints would be greatly appreciated.

0 Likes

(Rich Koshak) #2

Catch the output and log it:

    val results = executeCommandLine(..., 5000)
    logInfo("Test", results)

This should tell you any error or other output generated by the Python script itself.

See

0 Likes