10.10.10.10:8000
10.10.10.10:8001
file_lines = ['"http":','"http://"'+,.join([' '])for x in f.readlines(),+',"']
“http”: “http://10.10.10.10:8000”,
“https”: “http://10.10.10.10:8001”,
:)
I don't know if this is what you need, but I coded something real quick.
But keep in mind:
So I hope this helps:
lineList = [line.rstrip('\n') for line in open("path_to_data.txt")]
outArr = []
for line in lineList:
outArr.append('"http": ' + '"http://'+ line + '",')
for item in outArr:
print(item)
I tested it with this data:
10.10.10.10:8000
10.10.10.11:8000
10.10.10.12:8000
10.10.10.13:8000
10.10.10.14:8000
10.10.10.15:8000
10.10.10.16:8000
10.10.10.17:8000
And this is my output:
"http": "http://10.10.10.10:8000",
"http": "http://10.10.10.11:8000",
"http": "http://10.10.10.12:8000",
"http": "http://10.10.10.13:8000",
"http": "http://10.10.10.14:8000",
"http": "http://10.10.10.15:8000",
"http": "http://10.10.10.16:8000",
"http": "http://10.10.10.17:8000",
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.