I am trying to create a python script which will take input from text file and run an external command.
The content of file media.txt is as below:
1234
6753
9897
5656
import os with open('media.txt') as f: lst = [i.strip() for i in f] length=len(lst) print(length) i=length for x in range(i): os.system('mediacontent.exe -m lst[i]') print(lst[i]) i+=1Please help me to insert the value of lst[i] in the command.
The content of file media.txt is as below:
1234
6753
9897
5656