cia_b.py - import requests time from concurrent.futures...

This preview shows page 1 out of 1 page.

import requests, time from concurrent.futures import ProcessPoolExecutor def download(flag): prefix = '- factbook/graphics/flags/large/' flagUrl = prefix + flag + "-lgflag.gif" response = requests.get(flagUrl).content if response: with open("flags.txt" + flag + ".gif","wb") as f: f.write(response) return len(response) def main(): with open("flags.txt") as f_file: flags = (line.strip() for line in f_file)

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture