I've got 3 files in total : clean.txt, origin.py and pump.py
Clean.txt has some lines in it (actually website links. For eg:
www.link1.com
www.link2.com
www.link3.com
www.link4.com
origin.py is the script that's reading lines one by one and I want this script to send the link (one at a time) to pump.py
pump.py is a script which asks me for one input, which is a link.
Now, I want to make it so that I read lines from clean.txt (origin.py is doing this task) and send them to the pump.py one at a time. Like a loop. Code for Origin.py is :
fo = open("Clean.txt", "r")
nremoval = str(fo.readlines()).replace('\\n','')
for lines in fo :
if __name__ =="__main__":
response = nremoval
p = subprocess.Popen("pump.py", stdin = subprocess.PIPE)
time.sleep(2)
p.stdin.write(bytes(response, 'ascii'))
print("injected string :", response)