python - Run Code from Script -


i feel stupid question, can't seem this.

how create shell script takes python script in subdirectory , runs it.

so, following directory

├── shell_command.sh   ├── code_sub_directory   │   ├── python_code_1.py   │   └── python_code_2.py   ├── input_data       └── data.txt 

i'm trying create script (called shell_command.sh) runs python_code_1.py , python_code_2.py subdirectory code_sub_directory.

here script have far:

#!/usr/bin/python  ./code_sub_directory/python_code_1.py 

which gives error:

./code_sub_directory/python_code_1.py ^ syntaxerror: invalid syntax logout 

change shebang #!/bin/bash. it's shell script not python script.

your shell_command.sh should this:

#!/bin/bash  ./code_sub_directory/python_code_1.py 

Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -