The goal is to get my text file that contains 1 proxy per line, formatted as ip:port
into a dictionary in my python script. Having a blast with python so far, but this issue is making me want to pull my hair out-- I've read many many questions but none of them seem to be quite what I'm looking for.
this is the what i'm currently working with:
proxies = {}
def addproxies(a,b,proxies):
proxies[ip].append(a),
proxies[port].append(b)
return proxies
def main():
with open('proxies.txt', 'r') as this_file:
for line in this_file:
addproxies((this_file.split(':'),[0]),(this_file.split(':')[1]),proxies)
Any help greatly appreciated