0

So I have this script that I need to develop that runs constantly and runs others scripts every month, and in case anything goes wrong I need it to send an email alert, as I was implmenting it I first tested this very simple piece of code

import datetime, time

while True:
    now = datetime.datetime.now()
    if now.strftime("%d") == '10':
        try:
            import download_ibama
        except Exception as e:
            print(e)
            
        time.sleep(86400)

the problem is, it runs the program perfectly as I want it, but it raises an exception telling me that there is no module named "download_ibama" how can I overcome it? cause the program did what I wanted it to do, I want it to raise an exception just in case it doesn't

P.S. "download_ibama" is the other script that i am calling, they're both in the same directory

Fabricio_A
  • 58
  • 7

0 Answers0