title: Why Tkinter and PIL image is not working on Windows Task Scheduler but works on cmd
body: <p>I have some trouble at showing Tkinter + PIL image on the Windows Task Scheduler. It is works flawlessly when i compile using CMD, but the image won't appear on Task Scheduler.</p>
  
  <p>Here is some of my simple code:</p>
  
  <pre><code> import Tkinter as tk
   import time
   from PIL import ImageTk, Image
  
  
   def close():
        global root
        root.quit()
        return; 
  
   root = tk.Tk()
   img = ImageTk.PhotoImage(Image.open('C:\xxx\xxx\Desktop\RedAlert.jpg'))
  
   def alert():
       global img
  
       panel = tk.Label(root, image = img, height=2000, width=2000)
       panel.pack(side = "bottom", fill = "both", expand = "yes")
       root.after(10*500, root.destroy)
       root.mainloop()
  
   count = 0
   while(count &lt; 3):
      count = count+1
      time.sleep(1)
      if count == 2:
          alert()  
      print count
  </code></pre>
  
  <p>I am using Windows 10. I also have tried to some Wav Sound with this code and some blink LED using arduino by serial. Everything works fine either on CMD and Windows Task Scheduler, except for the Image it's never pop up on The Task Sch.. I have tried to save in pyw, Bat, but still not working. Please Help me guys. :(</p>