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
Post a Comment