Python Forum
executing a bash file - revisited
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
executing a bash file - revisited
#1
Hi,

I'm trying to execute the line below from a .py file but I get an error: File not found.
However, if I execute it directly as sh restartMM.sh, it executes with no errors.

What am I doing wrong?

TIA

#sub.call("sh /home/pi/MagicMirror/restartMM.sh", shell=True) # same results
p = sub.run("sh /home/pi/MagicMirror/restartMM.sh")
print(p.returncode)
Reply


Messages In This Thread
executing a bash file - revisited - by ebolisa - Feb-09-2021, 08:56 PM
RE: executing a bash file - revisited - by Serafim - Feb-09-2021, 10:28 PM
RE: executing a bash file - revisited - by ebolisa - Feb-10-2021, 11:06 AM
RE: executing a bash file - revisited - by ebolisa - Feb-10-2021, 04:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Function not executing each file in folder mathew_31 9 2,282 Aug-22-2022, 08:40 PM
Last Post: deanhystad
  Showing and saving the output of a python file run through bash Rim 3 2,483 Oct-06-2021, 10:48 AM
Last Post: gerpark
  file.write stops while true loop from executing in python3 boonr 3 3,134 Mar-25-2019, 12:50 PM
Last Post: ichabod801
  Executing external Python file in background and get output in python nakiscia 0 4,978 Feb-15-2018, 02:07 PM
Last Post: nakiscia
  executing a file saved in memory Skaperen 0 2,394 Sep-04-2017, 04:23 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020