Consider the difference between:
- Bash command to run a Python script which takes multiple file name arguments:
python script.py file1.txt file2.txt file3.txt
- Bash command which runs a Python script multiple times:
for file in file1.txt file2.txt file3.txt; do
python script.py $file
done
To be similar to the difference between:
def print_many_str(list_of_str):
for s in list_of_str:
print(s)
print_many_str(["aaa", "bbb", "ccc"])
and
def print_one_str(my_str):
print(my_str)
for s in ["aaa", "bbb", "ccc"]:
print_one_str(s)