title: How to make python script update in realtime (run continuously)
body: <p>Hello I am a beginner in python and I just learned the fundamentals and basics of programming in python. I wanted to make this program that will notify me when my class ends, however, once I run my program it only executes it once  </p>
  
  <p>When I loop it, it does not continuously access my date and time (instead it takes the time from when the code is executed). Any suggestion on how to resolve this problem? </p>
  
  <pre><code>import win10toast
  
  import datetime
  
  currentDT = datetime.datetime.now()
  
  toaster = win10toast.ToastNotifier()
  
  while (1):
      def Period_A():
          if currentDT.hour == 7 and currentDT.minute == 30:
              toaster.show_toast('Shedule Reminder', 'It is Period A time!', duration=10)
  </code></pre>
  
  <p>I wanted the code to run in the background and update the value of the date and time continuously so that the notification will appear on the desired time not the time when the code is executed ;).</p>