I have a function named tmp
that only returns two strings. In addition, I have 2 iterables that I want to pass to the tmp
function, one of them has 88000 lengths and another one has 50 lengths. I want to change the second one on every 200 iterates, but the problem is I can not iterate over the second iterable. Here is what I've done so far.
Code:
from itertools import repeat
url_list = [] # contains over 80000 urls
files = [] # contains 50 files
def tmp(url, file):
return url, file
# I want to use the file for only 200 URLs and then change it and use the next one in the list(files) provided
list(map(tmp, url_list, map(lambda x: repeat(x, 200), files)))
Expected output:
url1, file1
url2, file1
url3, file1
.
.
url201, file2
url202, file2
.
.
.
url401 file3
url402 file3
.
.
Any help would be highly appreciated.