查(select * from 表名) 基本语法: select <字段1,字段2,...> from <表名> where <表达式>; 例如,查询student表中所有的记录,在终端窗口输入命令: select id,name,age from employee; 也可以查询限定的记录,输入如下命令,可以限定查询结果为第0条到第1条记录,也就是返回第一条记录: select * from empolyee limit 0,3; 也可以查询通过年龄限制查询 selec…
记录基本操作: 增:(insert into) 基本语法: insert into 表名(字段) values(对应字段的值): 例子1: insert into employee(id,name,age,salary) values(1,"憨憨",24,5000); 指定添加insert into employee values(2,"憨憨",0,24,"技术部",5000); 对应添加 insert into employee set nam…
数据库操作(DDL) 在数据库下创建表(create_table) 创建表代码块: CREATE TABLE employee( id TINYINT PRIMARY KEY auto_increment, name VARCHAR(25), gender boolean, age INT, department VARCHAR(20), salary DOUBLE(7,2)); 添加字段: 删除字段: 修改字段:…
MyWeb框架: from wsgiref.simple_server import make_server def application(environ, start_response): print(environ) start_response('200 OK', [('Content-Type', 'text/html')]) return [b'<h1> Hello,web! </h1>'] httpd = make_server('',8080,application…
自定制property class Lazyproperty: def __init__(self,func): # print('==========>',func) self.func=func def __get__(self, instance, owner): print('get') # print(instance) # print(owner) if instance is None: return self res=self.func(instance) setattr(ins…
.的用法 import re s = 'fhsdjakaxdsancjh' # .代表一个元素,完成模糊匹配 res = re.findall("a..x", s) # 找到s中以a开头x结尾中间有两个元素的结果 print(res) # ['akax'] res1 = re.findall("^f..d", s) # ^代表只能从字符串的开头进行匹配 print(res1) # ['fhsd'] res2 = re.findall("n..h$"…
Python学习-第二天-字符串和常用数据结构 字符串的基本操作 def main(): str1 = 'hello, world!' # 通过len函数计算字符串的长度 print(len(str1)) # 13 # 获得字符串首字母大写的拷贝 print(str1.capitalize()) # Hello, world! # 获得字符串变大写后的拷贝 print(str1.upper()) # HELLO, WORLD! # 从字符串中查找子串所在位置 print(str1.find('o…
figure:last-child { margin-bottom: 0.5rem; } #write ol, #write ul { position: relative; } img { max-width: 100%; vertical-align: middle; } button, input, select, textarea { color: inherit; font: inherit; } input[type="checkbox"], input[type=&quo…
python学习第二次记录 1.格式化输出 name = input('请输入姓名') age = input('请输入年龄') height = input('请输入身高') msg = "我叫%s,今年%s 身高 %s" %(name,age,height) print(msg) # %s就职一个占位符, # %(name,age,height)就是把前面的字符串与括号后面的变量关联起来 # %s就是代表字符串占位符,除此之外,还有%d是数字占位符 input接收的所有输入默认都是…
figure:last-child { margin-bottom: 0.5rem; } #write ol, #write ul { position: relative; } img { max-width: 100%; vertical-align: middle; } button, input, select, textarea { color: inherit; font: inherit; } input[type="checkbox"], input[type=&quo…