I am stuck in a problem from couple of days, the problem is very simple. I want to run a code with many functions in it, some functions are related to tkinter gui, one function is related to creating tcp stream, one function is to press the button and send a message on tcp stream. I want all the the processes to run at the same time,like while i see front end gui of tkinter , i also want a backend tcp steams process and when i press the button on tkinter it send message on tcp streams. All processes should be concurrent. I couldn't achieve this in my code. Below is the code.
from tkinter import *
root =Tk()
def func1():
#tkinter stuff
def func2():
#button on tkinter window when pressed should send message on tcp stream
def func3():
serversocket = socket.socket(
socket.AF_INET, socket.SOCK_STREAM)
# get local machine name
host = "192.168.0.100"
port = 21600
# bind to the port
serversocket.bind((host, port))
# queue up to 5 requests
serversocket.listen(5)
while True:
# establish a connection
clientsocket, addr = serversocket.accept()