01 2020 档案

摘要:1.not null和default # sex字段不可为空,默认值为'男' create table t2( id int, name char(10), sex enum('男','女') not null default '男' ); 2.unique key 单列唯一: # id和name字 阅读全文
posted @ 2020-01-16 23:19 手可摘星辰。 阅读(151) 评论(0) 推荐(0) 编辑
摘要:1.创建表 create table 表名( 字段名1 类型[(宽度) 约束条件], 字段名2 类型[(宽度) 约束条件], 字段名3 类型[(宽度) 约束条件] ); # 1.在同一张表中,字段名不能相同 # 2.宽度和约束条件可选 # 3.字段名和类型是必须的 2.查看表 查看表结构: desc 阅读全文
posted @ 2020-01-14 21:11 手可摘星辰。 阅读(131) 评论(0) 推荐(0) 编辑
摘要:1.协程 1.本质上是一个线程。 2.能偶在多个任务之间切换来节省一下IO时间。 3.协程中任务之间的切换也消耗时间,但开销要远远小于进程和线程之间的切换。 真正的协程模块就是使用greenlet来完成多个任务之间的切换。 from greenlet import greenlet def eat( 阅读全文
posted @ 2020-01-05 19:03 手可摘星辰。 阅读(161) 评论(0) 推荐(0) 编辑
摘要:1.线程池 import time from concurrent.futures import ThreadPoolExecutor def func(n): time.sleep(2) print(n) t_pool = ThreadPoolExecutor(max_workers=5) # 创 阅读全文
posted @ 2020-01-02 19:50 手可摘星辰。 阅读(327) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示