Start Bash Skript with snips


#1

Hi everyone, I try to start a Bash script in the Python Snippets area in the app action tab but it isn’t working. Can anybody tell me what I am doing wrong?

Here is what I tried:

import subprocess
subprocess.call (home/pi/test.sh)

Thanks!


#2

use google and search for “subprocess python” and find the answer to how to use the function correctly

subprocess.call (['home/pi/test.sh'])

i prefer something like

interface = Popen(['home/pi/test.sh'], stdout=PIPE, stderr=PIPE)
stdout, stderr = interface.communicate()

that way you can check for errors etc


#3

What error message do you get in /var/log/syslog?