Now I am able to pass the whole list from batch file to python but I want to pass the each element in each looping. How can I achieve this?
sub.py
import subprocess
import random
item = subprocess.Popen(["test.bat", str(random.randrange(0,20))] ,
shell=True, stdout=subprocess.PIPE)
for line in item.stdout:
print line
test.bat
set list=hai hello trial
(for %%a in (%list%) do (
echo %%a
))