TCP/IP 1,建立连接(三次握手) 1,客户端发起请求 2,服务器请求回应 3,请求确认,双方建立连接 2,数据传输 3,断开连接(四次挥手) 1,客户端请求断开 连接 2,服务器回应请求 3,服务器向客户端请求断开连接 4,客户端回应请求 套接字: 三种套按字:1,监听套接字:2,客户端套接字:3,对等套接字 服务器 # 服务器 import socket server = socket.socket() # 实例化 # print(server) # 监听套接字 # <socket.so…
index.html 首页 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="css/reset.css"> <!--引入本地--> <link rel…
index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="css/reset.css"> <link rel="stylesheet&quo…
index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="css/reset.css"> <link rel="stylesheet&quo…
index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="css/reset.css"> <link rel="stylesheet&quo…
类的定义 共同属性,特征,方法者,可分为一类,并以名命之 class Abc: # class 定义类, 后面接类名 ( 规则 首字母大写 ) cls_name = '这个类的名字是Abc' # 在类里定义的变量 是 属性 print( Abc.cls_name ) Abc.binbin = '正在25班教室' # 可以通过 类名.属性名 = 属性值 给类添加属性 print( Abc.binbin ) ------>>>>> 这个类的名字是Abc 正在25班教室 类是一个独…
#斐波那契 def fid(n): res = [] indx = 0 a = 0 b = 1 while indx < n : res.append(b) a,b = b,a+b indx += 1 return res print(fid(1000)) # 生成器 def fid(n): indx = 0 a = 0 b = 1 while indx < n : yield b # 暂停并返回 跳出函数 res.append(b) a,b = b,a+b indx += 1 f = fid…
线程,进程,是实现并发的方法, 并行: 在同一时刻,同时运行多个任务,CPU 的数量大于等于任务数量, 并发: 在同一时间间隔内, 同时处理多个任务, 并行是并发. 进程:表示一个正在执行的程序, 操作系统负责其上所有的执行 多进程 import multiprocessing # from multiprocessing import process import time # 模拟一个好使任务 print('a:',time.asctime(time.localtime(time.time(…
tornado 相关说明 在 handler 中创建一个  chat.py 文件,用来处理聊天室 在 templates 模板文件夹下创建 room.html 文件,是个聊天室 做好服务器的准备…
u胎代码实现 : 针对每一个 app 写个 js 脚本, 先给 users 的 app 应用创建个 js:在指定目录下的 js 文件夹下,创建 users 文件夹,下创建 suth.js ,图片验证 // 预加载,html 加载完后再加载 , $(function () { let $img = $(".form-item.captcha-graph-img img"); //获取图像标签元素 let sImageCodeId = "" // uuid (小写 s…