私は公式ドキュメントにあった、see this example:この表現を理解する方法: ":URLのURL future_to_url = {executor.submit(load_url、URL、60)"
urls = ['http://www.foxnews.com/',
'http://www.cnn.com/',
'http://europe.wsj.com/',
'http://www.bbc.co.uk/',
'http://some-made-up-domain.com/']
def load_url(url, timeout):
with urllib.request.urlopen(url, timeout=timeout) as conn:
return conn.read()
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
future_to_url = {executor.submit(load_url, url, 60): url for url in urls}
for future in concurrent.futures.as_completed(future_to_url):
url = future_to_url[future]
try:
data = future.result()
except Exception as exc:
print('%r generated an exception: %s' % (url, exc))
else:
print('%r page is %d bytes' % (url, len(data)))
しかし、私はドン」にT understant表現の意味:
"future_to_url = {executor.submit(load_url、URL、60):URLのURL"
は、それがどの文法ポイントからですか?ありがとう!
ありがとうございます。 – Devin
大歓迎です! @Devin。 – zhenguoli