07 2019 档案
摘要:1 class Test(object): 2 @property 3 def test(self): 4 return 100 5 6 @test.setter 7 def test(self): 8 return "修改" 9 10 @test.deleter 11 def test(se...
阅读全文
摘要:注 :带参数装饰器,在原有闭包的前提下,再加一层
阅读全文
摘要:# 为字符串添加HTML标签 import time def zhuang(fun): def zhaung_1(*args, **kargs): # time.sleep(1) html_str = ""+fun()+"" return html_str return zhaung_1 def zhuang1(fun): ...
阅读全文
摘要:1 -- 子查询 2 -- 一句查询语句内,再套一句查询语句 ,叫子查询 3 -- 查询班级类身高最高的人的名字 4 select name from students where high=(select max(high) from students); 5 select id as "序号", name as "姓名",high as "身高...
阅读全文
摘要:-- 分页 -- limit -- limit start count (start 显示骑士值,单页数量) select *from student where gender=1 limit 6,3; -- 分页 -- 以3行为一页,分页 -- 第一页 select *from student limi...
阅读全文
摘要:1 -- 分组 2 -- group by 3 -- 分组只有与聚合函数一起使用才能发挥作用 4 -- 分组只限于字段分明 例如 性别 ,部门, 5 --列出所有性别 6 select gender from student group by gender; 7 --列出所有性别 及数量 8 se...
阅读全文
摘要:1 --聚合函数 2 -- sum() 3 -- 求和 4 select sum(age) from student; 5 6 -- count() 7 -- 求数量 8 -- 数据量 9 select count(*) as '数量' from student; 10 11 -...
阅读全文
摘要:1 -- 排序 2 -- order by 排序 默认为升序 3 -- asc 升序 4 -- desc 降序 5 -- 查询身高 分别用升序和降序 6 select *from student order by high asc; 7 select *from student order by hig...
阅读全文
摘要:转载注明出处:https://www.cnblogs.com/jum-bolg/p/11235427.html
阅读全文
摘要:1 --模糊查询 2 --like 3 --%至少替换一个 4 -- _只替换一个 5 -- 查姓李的人 6 select *from student name like "李%"; 7 -- 查名为杰伦的人 8 select *from student name like "_杰伦"; 9 10 --rlike 11 -- 正则匹配查询 ...
阅读全文
摘要:1 --去重查询 distinct 2 select distinct gander from student; 3 4 --逻辑查询 5 and or not 6 --查询18-28之间的数据 7 select *from student age>18 and age18 and name="lady"; 10 --多条件查询 11 select ...
阅读全文
摘要:前戏 --创建表 create table xxx( id int unsigned not null auto_increment primary key, name varchar(20) not null ); 1.增 --全字段插入 insert into xxx values(0,"王老五
阅读全文
摘要:以下以student表为例 --查看表结构 desc student; --添加字段 alter table student add (字段名)age (数据类型)int unsigned (约束)not null default 0; alter table student add birthda
阅读全文
摘要:1.备份原文件 1 sudo cp /etc/apt/sources.list /etc/apt/sources_list.bak 2.加载文件 vim:vim sourses.list ubuntu desktop :sudo gedit /etc/apt/sources.list 3.更改原文件
阅读全文
摘要:1 # -*- coding: utf-8 -*- 2 # @Time : 2019-07-17 1:39 3 # @File : 网络socket实现http服务器.py 4 # @Software: PyCharm 5 6 import socket 7 import re 8 9 10 def server_conn(conn,file_name): 11 ...
阅读全文
摘要:import timedef fun1(): while True: print("fun1") time.sleep(0.1) yielddef fun2(): while True: print("fun2") time.sleep(0.1) yieldif __name__ == "__mai
阅读全文
摘要:1 import pygame 2 from first_pygame.plane_spirit import * # 调用重载的精灵类 3 4 # 初始化 5 pygame.init() # 初始化所有所...
阅读全文