| futures3. Attuazione futures in stile Java in Python 3.x |
Scarica ora |
futures3. Classifica e riepilogo
- Nome editore:
- Brian Quinlan
futures3. Tag
futures3. Descrizione
Attuazione futures in stile Java in Python 3.x Futures3 è un modulo che implementa i futures in stile Java per Python.esempio: "Scarica molti URL in parallelo." Importa Functoolsimport urllib.requestimport Futuresurls = DEF Load_url (URL, Timeout): ritorno urllib.request.urlopen (URL, Timeout = Timeout). Read () con futures.threadpoolexecutor (50) come esecutore: future_list = exetrour.run_to_futures () per URL, futuro in ZIP (URLS, FUTURE_LIST): se future.Exception () non è nessuno: stampa '% r generata un'eccezione:% s'% (URL, FUTURE.Exception ()) Else: Stampa '% r Pagina è% d Byte'% (URL, LEN (FUTURE.Result ())) Requisiti: · Python.
futures3. Software correlato