Purpose: I want to run a Python program from within a shell script
This time, let's assume you have a Python program called test.py and let it run. Easy to do. Just write "python3 filename.py" in the shell script !!
test.sh
#!/bin/bash
python3 test.py
test.py
print("hello")
Execute ↓
$ chmod +x test.sh
$./test.sh
hello #result
Recommended Posts