openHab python script launcher

Hi there, i’m trying to execute python script with executeCommandLine but i can’t figure it out how to do it…
Python is installed in c:\python (2.7.13), the script is located in c:\openhab2\confg\scripts\
System: windows 10 x64
Exec Binding installed
Thanks a lot!!

Please post your rule that includes the executeCommandLine.


I’m first trying on openhab console before creating a rule, i’m having problem on scripting for the exec path and script path…
i have tried with:
executeCommandLine(“c:/python/python c:/openhab2/conf/scripts/”)
executeCommandLine(“python/python /conf/scripts/”)

and many more syntax

Hello Alessandro,

Try : executeCommandLine(“c:/python/python@@c:/openhab2/conf/scripts/”)

In the command string, every space must be replaced with @@

Thanks Alain, but nothing happen… also on log:tail

If you test your script in the Karaf console, you should escape the quotes surrounding the command string:

smarthome:> executeCommandLine(\“c:/python/python@@c:/openhab2/conf/scripts/\”)

This does not apply to .rules file :

	Item my_switch received command

nothing Alain…thanks anyway i don’t understand…
on the log i see “executed commandline […]” but nothing happen…

Have you tried backslashes i.e. executeCommandLine(“c:\python\python@@c:\openhab2\conf\scripts\”) ?