S
S
S1NYA2021-08-24 13:00:44
Python
S1NYA, 2021-08-24 13:00:44

How to rewrite this script for a robot with repetitions?

I have a script like this

:

def parse_proxy_line(line: str) -> Tuple[str, int]:
    addr, _, port = line.strip().rpartition(':')
    return (addr, int(port))
def is_good_proxy(proxy: Tuple[str, int]) -> bool:
    host, port = proxy
    return ...
src = open('C:\\Users\\sinto\\PycharmProjects\\AutoREG\\Proxy.txt', 'rt')
 
proxies = iter(filter(is_good_proxy, map(parse_proxy_line, src)))
 
for i in range(3):
    host, port = next(proxies)
    print(host, port)

I need it to save already used proxies to a file, and then just skip them when restarting the script (for i in range). How to do it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question