if __name__ == '__main__':
multiprocessing.freeze_support ()
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = ip
port = 8007
s.bind((host,port))
s.listen(100)
conn, addr = s.accept()
while True:
while True:
data = conn.recv(1024)
if not data:
break
print('client is at', addr, data.decode("utf-8"))
conn.send(data.upper())
conn.close()
import time
from multiprocessing import Process
print("начало")
def aa():
time.sleep(1)
print("Конец кода")
if __name__ == '__main__':
p = Process(target=aa)
p2 = Process(target=aa)
p3 = Process(target=aa)
p.start()
p2.start()
p3.start()
C:\Users\Дима\Desktop\pp>python mail.py
начало
начало
начало
начало
Конец кода
Конец кода
Конец кода