Using Python to execute a command on every file in a folder

前端 未结 6 1056
旧时难觅i
旧时难觅i 2020-12-01 01:44

I\'m trying to create a Python script that would :

  1. Look into the folder \"/input\"
  2. For each video in that folder, run a mencoder command (to transcode
6条回答
  •  失恋的感觉
    2020-12-01 02:20

    Python might be overkill for this.

    for file in *; do mencoder -some options $file; rm -f $file ; done
    

提交回复
热议问题