Apr-03-2024, 08:26 PM
You can call a python program directly. No need for a shell script. Make sure your python program file is executable (chmod +x). You can add a shebang at the top of the file to tell it what python interpreter to use. For example:
program.py
program.py
#!/usr/bin/python3 import sys print(len(sys.argv), sys.argv)
Output:$ ./program.py a "b c" "d e f g"
4 ['./program.py', 'a', 'b c', 'd e f g']