简体   繁体   中英

Bash script to execute a Python program

I am trying to write a bash script which can get all the file names from a folder and execute another Python script which takes one file name at a time.

How do I do that?

for file in /path/*
do
  python main.py "$file"
done

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM