摘要: 开启线程的两种方式 from threading import Thread import time def task(name): print('%s is running'%name) time.sleep(1) print('%s is over'%name) # 开启线程不需要在main下面 阅读全文
posted @ 2020-04-26 19:36 清轩挽长风 阅读(122) 评论(0) 推荐(0)
摘要: 服务端 from multiprocessing import Process from threading import Thread import socket def lunch(conn): while True: res = conn.recv(1024) if len(res) == 0 阅读全文
posted @ 2020-04-26 19:28 清轩挽长风 阅读(143) 评论(0) 推荐(0)