code :
import re
import json
#open("sbins.txt","r")
data = open("sbiiins.txt","r")
contents = data.read().strip()
for i, p in enumerate(re.findall(r'"password":[^"]*"(.*?)"', contents):
print('{}="{}"'.format(i, p))
this code prints outputs this below strings by parsing a text file :
1="pass1425-*"
2="pass1234- "
3="pass0*++"
4="pass*-+"
i need to use these print statements and use them in loop
for example :
ids = (1,2,3,5,6,7,8)
for ind in ids:
a= ids
....
....
In above code
1 should return pass1425-*
2 should return pass1234-
...