Feb-09-2021, 10:28 PM
First I assume that you have started your program with
Even so, you try to invoke a shellscript, but that is not the intended use for subprocess. It is meant to start a process and one of the arguments may be a file. Your call makes subprocess try to interpret the argument as a file named
import subprocess as subIf not, the code makes no sense.
Even so, you try to invoke a shellscript, but that is not the intended use for subprocess. It is meant to start a process and one of the arguments may be a file. Your call makes subprocess try to interpret the argument as a file named
"sh /home/pi/MagicMirror/restartMM.sh"
. If you take away "sh " it will complain about file permissions unless you have made it executable. Another way is:import os p = os.system("sh /home/pi/MagicMirror/restartMM.sh") print(p)