Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12201

How to run python script (which do operation with 1 file) with different files at 1 go using list of files? [closed]

$
0
0

I have python script which do some operations with 1 file. I run it and it do it with 1 file whose name stated in script. I have script where states file_name.mp4 (which script do operations which) and resulting file file_name.mp4.srt. To do operations with 1 file i just replace these 2 files names (and paths if needed) with new file name and proceed it. And next file and so on.

I have list of files (with or without paths) which needed to be proceeded with script.How to make it so script just pasting each file (from list) to these 2 file_name.mp4 and file_name.srt.mp4 and just execute it and next file and so on until full list executed?Code have simple operation of creating srt file (most part of it) and just 2 file names (1 input (.mp4) and 1 output (mp4.srt)).

Now i described it correctly. Thanks.

Some lines of code:

audio_url = "file_name.mp4" with open("file_name.mp4.srt", "w", encoding="utf8") as outfile:

Other lines is not changing, its constant everytime. I change these 2 lines to execute new file.


Viewing all articles
Browse latest Browse all 12201

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>