I'm trying to run the code below on a Windows Server instance which doesnt allow me to install Python. I've created an exe using pyinstaller. The code runs but instead of staying in the infinite loop the terminal closes and stops running after the code has been executed once.
Can anyone shed some light please?
import shutil
import time
import datetime
backup_time = int(input('Enter the backup time interval in minutes: ')) * 60
while True:
shutil.copytree("src", "dstn" + datetime.datetime.now().strftime("%d-%m-%Y %H-%M-%S"))
print ('I have made a backup of the rotas ' + datetime.datetime.now().strftime("%d-%m-%Y %H:%M:%S"))
time.sleep(backup_time)
question from:https://stackoverflow.com/questions/66050043/infinite-loop-not-infinite-pyinstaller-executable