2019年12月19日
摘要: 1.创建新表 create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..) 2.根据已有的表创建新表 A:create table tab_new like tab_old (使用旧表创建新表) 阅读全文
posted @ 2019-12-19 10:07 zl666张良 阅读(1338) 评论(0) 推荐(0)
  2019年7月14日
摘要: 1 class AgeError(Exception): 2 3 def __init__(self, age): 4 self.age = age 5 6 def __str__(self): 7 return "您输入的年龄有误!%d"%self.age 8 9 class Person(object): 10 11 ... 阅读全文
posted @ 2019-07-14 17:28 zl666张良 阅读(132) 评论(0) 推荐(0)
  2019年7月9日
摘要: import json# dump 和 dumps的使用dict = {"name": "张飞", "age": 30, "sex": "女"}dumps 写入的直接是dict 而dump则dict和文件对象with open("fucker.txt", "w", encoding="utf8") 阅读全文
posted @ 2019-07-09 16:18 zl666张良 阅读(636) 评论(0) 推荐(0)
  2019年6月27日
摘要: MySQL 插入数据时,中文乱码问题的解决 当向 MySQL 数据库插入一条带有中文的数据形如 insert into employee values(null,'张三','female','1995-10-08','2015-11-12','Sales',2000,'是个好员工!'); 出现乱码时 阅读全文
posted @ 2019-06-27 13:12 zl666张良 阅读(2610) 评论(0) 推荐(0)