I have this code:
ipaddr = input("Enter IP Address: ")
devicename = input ("Enter Device Name: ")
for i, d in zip(ipaddr.split(), devicename.split()):
print("Your IP is: ", i, "Your device is: ", d)
My output is this:
Enter IP Address: 1 2 3 4 5
Enter Device Name: d1 d2 d3 d4 d5
Your IP is: 1 Your device is: d1
Your IP is: 2 Your device is: d2
Your IP is: 3 Your device is: d3
Your IP is: 4 Your device is: d4
Your IP is: 5 Your device is: d5
I would like each line above (IP and device name combination) to be saved into individual txt files like this:
C:\Scripts
d1.txt
d2.txt
d3.txt
d4.txt
d5.txt
I am looking into creating another program to read those files individually some other time. For now I am looking into saving my output into different files. Hoping you could help. Thank you!