I have created tkinter GUI, where a sever socket program which accept connections from client and create a simple window for each clients. I tried to add image icons into it , but the image icons are not displayed and (I can add image to simple tkinter window seperately, while combine that to the below GUI fails.)
If i add images into the window then the window is not opened, (it opened ,while commenting the image add lines from the program)
S.py
import socket
from tkinter import *
from threading import Thread
from PIL import ImageTk, Image
root = Tk()
root.title("GUI")
root.geometry('350x200')
root.resizable(width=FALSE, height=FALSE)
def con():
    act_lb1.destroy()
    label_2 = Label(root, text="Activated")
    label_2.place(x=100, y=20, height=55)
    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        ip = "0.0.0.0"
        port = 4141
        s.bind((ip, port))
        s.listen(5)
        def window(c, ):
            while True:
                popup1 = Toplevel(root)
                popup1.title('Notification')
                popup1.geometry('250x100')
                prompt = " connectiing"
                label1 = Label(popup1, text=prompt, width=len(prompt))
                label1.pack(fill="none", expand=True)
                def close_after_2s():
                    popup1.destroy()
                popup1.after(4000, close_after_2s)
                #popup1.mainloop()
                top = Toplevel(root)
                top.title('H-PINGER')
                top.geometry("200x200")
                top.resizable(width=FALSE, height=FALSE)
                img = ImageTk.PhotoImage(Image.open("13.png"))
                panel = Label(top, image=img)
                prompt = "connected"
                user_lb = Label(top, text=prompt, width=len(prompt))
                user_lb.place(x=50, y=1, height=39)
                panel.place(x=6, y=1, height=39, width=39)
                def rm():
                      pass
                while True:
                   Thread(target=rm).start()
        while True:
            c, addr = s.accept()
            print('Connected with ' + addr[0] + ':' + str(addr[1]))
            if addr[0] != '':
                root.withdraw()
                thread2 = Thread(target=window, args=(c,))
                thread2.start()
        c.close()
        s.close()
    except socket.error as msg:
        print('Bind failed. Error Code : ' + str(msg[0]) + ' Message ' + msg[1])
        sys.exit()
sp = Button(root, text='Activate', anchor="center", font=30, width="18", height=3,bd=0, activebackground="darkgrey",  command=(lambda: con()))
act_img = PhotoImage(file="l3.png") # make sure to add "/" not "\"
sp.config(image=act_img)
sp.place(x=130,y=80, height=55, width=64)
act_lb1 = Label(root, text="Press the button to activate")
act_lb1.place(x=100, y=20, height=55)
root.mainloop()
C.py
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
port = 4141
ip = input('Enter the IP Address::')
s.connect((ip, port))