Answers for "run python script from bash script"

4

How to call one shell script from another shell script?

#!/bin/bash

#By Andrei Krasutski

SCRIPT_PATH="/path/to/script.sh"

# Here you execute your script
"$SCRIPT_PATH"

# or
. "$SCRIPT_PATH"

# or
source "$SCRIPT_PATH"

# or
bash "$SCRIPT_PATH"

# or
eval '"$SCRIPT_PATH"'

# or
OUTPUT=$("$SCRIPT_PATH")
echo $OUTPUT

# or
OUTPUT=`"$SCRIPT_PATH"`
echo $OUTPUT

# or
("$SCRIPT_PATH")

# or
(exec "$SCRIPT_PATH")
Posted by: Guest on January-08-2020
5

How to run bash script in python

import subprocess
print "start"
subprocess.call("sleep.sh")
print "end"
Posted by: Guest on May-20-2020

Code answers related to "run python script from bash script"

Python Answers by Framework

Browse Popular Code Answers by Language