Как запускать код повторно после окончания?

Есть вот такой код:

import pyautogui 
import webbrowser
import time
import json
from colorama import init, Fore, Style

init()
print(Fore.GREEN + 'Введите ссылку: ' + Fore.WHITE, end='')

s = input()

init()
print(Fore.GREEN + 'Время просмотра: ' + Fore.WHITE, end='')

tio = input()

print(tio)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1215, 180, duration = 0.2)
pyautogui.click(1124, 363, duration = 0.2)

time.sleep(5)

pyautogui.click(61, 21, duration = 0.2)
pyautogui.click(224, 303, duration = 0.5)

time.sleep(2) 

webbrowser.open(s, new=1)
print(Fore.GREEN + '1. Удачно ' + Fore.WHITE, end='')

time.sleep(2)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 215, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '2. Удачно ' + Fore.WHITE, end='')

time.sleep(3)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 245, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '3. Удачно ' + Fore.WHITE, end='')
time.sleep(3)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 275, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '4. Удачно ' + Fore.WHITE, end='')

time.sleep(3)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 305, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '5. Удачно ' + Fore.WHITE, end='')

time.sleep(3)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 335, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '6. Удачно ' + Fore.WHITE, end='')

time.sleep(3)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 365, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '7. Удачно ' + Fore.WHITE, end='') 
time.sleep(3)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 395, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '8. Удачно ' + Fore.WHITE, end='')

time.sleep(3)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 183, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '9. Удачно ' + Fore.WHITE, end='')

time.sleep(3)

pyautogui.click(61, 21, duration = 0.2, button='right')
pyautogui.click(224, 420, duration = 0.3)

time.sleep(tio)

Мне нужно зациклить код, но уже без input. То есть, чтобы input заново не запускался, а иммено вот этот код, и данные с input также оставались.

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1215, 180, duration = 0.2)
pyautogui.click(1124, 363, duration = 0.2)

time.sleep(5)

pyautogui.click(61, 21, duration = 0.2)
pyautogui.click(224, 303, duration = 0.5)

time.sleep(2) 

webbrowser.open(s, new=1)
print(Fore.GREEN + '1. Удачно ' + Fore.WHITE, end='')

time.sleep(2)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 215, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '2. Удачно ' + Fore.WHITE, end='')

time.sleep(3)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 245, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '3. Удачно ' + Fore.WHITE, end='')
time.sleep(3)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 275, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '4. Удачно ' + Fore.WHITE, end='')

time.sleep(3)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 305, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '5. Удачно ' + Fore.WHITE, end='')

time.sleep(3)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 335, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '6. Удачно ' + Fore.WHITE, end='')

time.sleep(3)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 365, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '7. Удачно ' + Fore.WHITE, end='') 
time.sleep(3)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 395, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '8. Удачно ' + Fore.WHITE, end='')

time.sleep(3)

webbrowser.open('https://yandex.ru/search/?text=.&clid=2411726&lr=62', new=2)
pyautogui.click(1297, 42, duration = 0.2)
pyautogui.click(1013, 136, duration = 0.5)
pyautogui.click(1087, 183, 2, duration = 1)

time.sleep(3)

webbrowser.open(s, new=2)
print(Fore.GREEN + '9. Удачно ' + Fore.WHITE, end='')

time.sleep(3)

pyautogui.click(61, 21, duration = 0.2, button='right')
pyautogui.click(224, 420, duration = 0.3)

time.sleep(tio)

Можете просто вписать цикл в код, а то в while не разбираюсь.


Ответы (0 шт):