Untitled
unknown
plain_text
a year ago
1.1 kB
7
Indexable
#DESAFIO 1 import webbrowser import threading import time def navegar_site(site): print(f'estamos navegando até o site {site}') #webbrowser.open_new(site) print(f'Navegando no site-->{site}') time.sleep(1) def baixar_fotos(): print(f'baixando fotos....') time.sleep(1) nova_thread = threading.Thread( target=navegar_site, args=('www.pinterest.com',),daemon=True) nova_thread.start() nova_thread.join() baixar_fotos() # DESAFIO 2 import webbrowser import threading import time import random def comentar(site, precos): print(f'Navegando até site {site} - Pesquisando sobre --> {precos}') time.sleep(5) print(f'{precos}... Processado com sucesso!') produtos =['celular', 'monitor', 'fone de ouvido', 'auto-falante', 'computador'] threads =[] for site in range(5): nova_thread = threading.Thread(target=comentar, args=('www.shoppe.com', produtos[site]),daemon=True) threads.append(nova_thread) for thread in threads: thread.start() for thread in threads: thread.join()
Editor is loading...
Leave a Comment