The program accesses the Internet to retrieve data from the list of source IDs. At night, the Internet often falls off, which leads to a program error. How to ensure trouble-free operation of the program, so that the list item is guaranteed to be processed? What you need to write after except: so that the program repeatedly refers to the try: block, until it processes it with the correct y result.
data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] def Scan_data(x): try: y = <..Обращение к интернету..> except: time.timesleep(60) # <..Тут не знаю что написать..> return y for i in data: Scan_data(i)
try? - pavelxmust be successfully processed one time. in an infinite loop, the function will receive the same result all the time - MIKSbreakbeforeexcept? - pavel