Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import httplib2
- from multiprocessing import Pool
- def xx():
- h = httplib2.Http(".cache")
- url_request = "http://localhost:5000/v1"
- headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36','Accepts':'*/*'}
- r, content = h.request(url_request, "GET",headers=headers)
- print (content)
- def xxx(i):
- for i in range (0,100000):
- xx();
- if __name__ == '__main__':
- num_processors = 3
- p=Pool(processes = num_processors)
- #get them to work in parallel
- output = p.map(xxx,[i for i in range(0,2)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement