DEV Community

loading...

not responding in tkinter when click button completely

hoangdaochuz
Khai
・1 min read

Client Code:

import tkinter as tk
from tkinter.filedialog import asksaveasfilename
import tkinter.messagebox
from PIL import Image
import socket
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
def ConnectToServer():
    HOST=entry.get()
    PORT=65432
    test=True
    try:
        s.connect((HOST,PORT))
    except Exception as e:
        tkinter.messagebox.showerror(title="Error",message="Error")
        test=False
    if test:
        tkinter.messagebox.showinfo(title="Noti",message="Connect Successfully")
def takeScreen():
    msg="TAKEPIC"
    s.sendall(bytes(msg,"utf8"))
    file = open('server_image.jpg', "wb")
    image_chunk = s.recv(2048)
    while image_chunk:
        if

Help me,please.
I'm beginner in python laguage

Discussion (0)