ImageURL='https://script-downloads.itarian.com/graphic-image.gif'## give here the direct download url for image

title = "RESTART REMINDER" #edit here

message = """REMINDER! Your computer will install Windows Updates TOMORROW night. 
Your computer will automatically restart after installing the updates. 
Please remember to save all work, close all applications, and leave your computer powered on.
""" #edit here



import Tkinter as tk
import urllib2
import ssl
import os
from Tkinter import *

Down_path=os.environ['TEMP']
fileName = ImageURL.split('/')[-1]
DownTo = os.path.join(Down_path, fileName)

def downloadFile(DownTo, fromURL):
    headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36'}
    context = ssl._create_unverified_context()
    request = urllib2.Request(fromURL, headers=headers)
    req = urllib2.urlopen(request,context=context)
    try:
        with open(DownTo, 'wb') as f:
            while True:
                chunk = req.read(100*1000*1000)
                if chunk:
                    f.write(chunk)
                else:
                    break
    except:
        return 'Please Check URL or Download Path!'

class GUI:
    def __init__(self,title,message,imagepath):
        self.root = tk.Tk()
        self.root.minsize(450, 100)
        self.root.eval('tk::PlaceWindow . center')
        self.image = PhotoImage(file=imagepath)
        self.canvas = Canvas(self.root,width=self.image.width(),height=self.image.height())
        self.canvas.pack()
        self.canvas.create_image(0,0,anchor=NW,image=self.image)
        self.root.title(title)
        self.label = tk.Label(text=message,font=("Arial", 10))
        self.label.pack(padx=5,pady=5)
        self.b1=tk.Button(self.root, text="ok", command=self.on_click, height = 1, width = 5, highlightbackground='#3E4149')
        self.b1.pack(padx=10,pady=10)
        self.root.attributes('-topmost',True)
        self.root.protocol("WM_DELETE_WINDOW", self.on_closing)
        self.root.mainloop()
    
    def on_click(self):
        self.root.destroy()
        print("user clicked on the ok button")
    
    def on_closing(self):
        self.root.destroy()
        print("user closed the window without clicking on the ok button")

downloadFile(DownTo, ImageURL)
GUI(title,message,DownTo)