[Tutor] Req Assistance with 1st Project.

Nym City nymcity at yahoo.com
Sun May 31 04:11:16 CEST 2015


Hello all,
I am working on my first Python project and I need some help. Here is what my project is about. I want to be able to read in from a text file that contains a list of IP addresses (maybe even hostnames) and write out each IP in the list in the following format: "172.0.0.1" OR "10.10.10.10" OR ......
After some online search, It seems like I would want to create a list (which I did) however, the challenge is that I can't figure out how to add the double quotes and OR after each entry in my list. 

Here is my current code (also attached):
f = open("BadIPList", "r+")
IOCs = []
for line in f:
    line = line.strip()
    IOCs.append(line)
print(IOCs)
f.close()
 Thank you in advance.


More information about the Tutor mailing list