02 2017 档案

摘要:写入用户注册信息的时候可以直接取出信息 def write_info(user,pwd,phone,email): aaaa = time.strftime('%Y-%m-%d-%H-%M-%S', time.localtime(time.time())) Session = sessionmake 阅读全文
posted @ 2017-02-27 17:21 200ML 阅读(107) 评论(0) 推荐(0)
摘要:class aa: def __init__(self): self.a = 'a' class bb(aa): def __init__(self): self.b = 'b' super(bb, self).__init__() print(self.a) obj = bb() class fo 阅读全文
posted @ 2017-02-27 15:16 200ML 阅读(116) 评论(0) 推荐(0)
摘要:corsor:not-allowed; 鼠标禁止 cursor: pointer; 鼠标小手 阅读全文
posted @ 2017-02-27 14:50 200ML 阅读(117) 评论(0) 推荐(0)
摘要:engine = create_engine("mysql+pymysql://root:123456@127.0.0.1:3306/ct?charset=utf8") 写入中文时候要加 ?charset=utf8 更多参照官网:http://docs.sqlalchemy.org/en/rel_1 阅读全文
posted @ 2017-02-26 12:27 200ML 阅读(9545) 评论(0) 推荐(0)
摘要:import smtplib from email.mime.text import MIMEText from email.utils import formataddr msg = MIMEText('邮件内容', 'plain', 'utf-8') msg['From'] = formataddr(["武沛齐",'wptawy@126.com']) msg['To'] = fo... 阅读全文
posted @ 2017-02-24 21:25 200ML 阅读(142) 评论(0) 推荐(0)
摘要:import datetime a = datetime.datetime.now() print(a) import time time.strftime('%Y-%m-%d-%H-%M-%S',time.localtime(time.time())) 阅读全文
posted @ 2017-02-24 21:04 200ML 阅读(110) 评论(0) 推荐(0)
摘要:class MainHandler: def __init__(self): self.host = "(.*)" self.ip = "^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$" self.port = "(\d+)" se... 阅读全文
posted @ 2017-02-24 10:01 200ML 阅读(659) 评论(0) 推荐(0)
摘要:create table userinfo( user_nid int auto_increment primary key not null, user_name char(16) not null, user_pwd varchar(64) not null, user_email varcha 阅读全文
posted @ 2017-02-22 22:05 200ML 阅读(101) 评论(0) 推荐(0)
摘要:思路: 获取所有有生物课程的人(学号,成绩) - 临时表 获取所有有物理课程的人(学号,成绩) - 临时表 根据【学号】连接两个临时表: 学号 物理成绩 生物成绩 然后再进行筛选 SELECT a_name,h_name,h_number FROM (select (student.student_ 阅读全文
posted @ 2017-02-17 19:59 200ML 阅读(168) 评论(0) 推荐(0)
摘要:1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 from sqlalchemy.ext.declarative import declarative_base 4 from sqlalchemy import Column, Integer, S 阅读全文
posted @ 2017-02-16 14:08 200ML 阅读(242) 评论(0) 推荐(0)
摘要:index 索引(普通索引创建) 例 show index from 表 (查看表的索引) 例 create index 索引名 on 表(列名) (创建普通索引) 例 drop 索引名 on 表;(删除普通索引) create table in1( nid int not null auto_in 阅读全文
posted @ 2017-02-15 15:34 200ML 阅读(165) 评论(0) 推荐(0)
摘要:delimiter \\ create PROCEDURE p1( OUT p_return_code tinyint ) BEGIN DECLARE exit handler for sqlexception BEGIN -- ERROR set p_return_code = 1; rollback; END; DECLARE... 阅读全文
posted @ 2017-02-15 11:44 200ML 阅读(138) 评论(0) 推荐(0)
摘要:1 Mysql基本操作 2 3 desc 降序 4 5 例 desc 表 (查看表的描述) 6 例 show create table 表(查看表怎么创建的) 7 例 show index from 表 (查看表的索引) 8 例 set profiling = 1; SQL 执行语句 show pr 阅读全文
posted @ 2017-02-15 11:07 200ML 阅读(199) 评论(0) 推荐(0)
摘要:prepare 准备 using 使用 deallocate 释放 execute 执行 delimiter $ drop procedure if exists proc $ create procedure proc() begin declare p1 int; set p1 = 11; se 阅读全文
posted @ 2017-02-15 10:05 200ML 阅读(773) 评论(0) 推荐(0)
摘要:delimiter $ drop function if exists f1 $ mysql> create function f1(l1 int,l2 int) returns int begin declare mun int; set mun = l1 + l2; return(mun); e 阅读全文
posted @ 2017-02-14 17:48 200ML 阅读(136) 评论(0) 推荐(0)
摘要:delimiter $ drop trigger if exists insert_color $ create trigger insert_color before insert on color for each row begin insert into co(cols) values(ne 阅读全文
posted @ 2017-02-14 16:27 200ML 阅读(126) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- coding:utf-8 -*- import pymysql import time # 创建连接 conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', passwd='', db='log') # 创建游标 设置光标用字典的格式获取 默认... 阅读全文
posted @ 2017-02-14 14:45 200ML 阅读(178) 评论(0) 推荐(0)
摘要:procedures 程序 exists 存在 declare 声明 default 默认 delimiter 定界符 向服务器说明以什么结束 begin 开始 then 然后 delimiter $ create procedure ttww() begin declare d1 int defa 阅读全文
posted @ 2017-02-14 11:33 200ML 阅读(186) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2017-02-14 09:47 200ML 阅读(104) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- coding:utf-8 -*- import pymysql import time conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', passwd='', db='log') cursor = conn.cursor(cursor=pymysql.cur... 阅读全文
posted @ 2017-02-13 22:40 200ML 阅读(115) 评论(0) 推荐(0)
摘要:select * from l1 left join s1 on l1.s1_nid = s1.nid left join color on l1.cos = color.nid where s1.pray = 'CEO'; 多对多 阅读全文
posted @ 2017-02-13 19:53 200ML 阅读(555) 评论(0) 推荐(0)
摘要:create table 表名( 列名 类型 是否可以为空, 列名 类型 是否可以为空 )ENGINE=InnoDB DEFAULT CHARSET=utf8 drop table 表名 delete from 表名 truncate table 表名 添加列:alter table 表名 add 阅读全文
posted @ 2017-02-13 16:55 200ML 阅读(163) 评论(0) 推荐(0)
摘要:CREATE TABLE `l1` ( `nid` int(11) NOT NULL AUTO_INCREMENT, `user` char(10) NOT NULL, `pwd` char(10) NOT NULL, `s1_nid` int(11) NOT NULL, PRIMARY KEY (`nid`), KEY `l1_s1` (`s1_nid`), CON... 阅读全文
posted @ 2017-02-13 16:43 200ML 阅读(204) 评论(0) 推荐(0)
摘要:1、增 1 2 3 insert into 表 (列名,列名...) values (值,值,值...) insert into 表 (列名,列名...) values (值,值,值...),(值,值,值...) insert into 表 (列名,列名...) select (列名,列名...) 阅读全文
posted @ 2017-02-13 14:18 200ML 阅读(171) 评论(0) 推荐(0)
摘要:简单方法(1) #!/usr/bin/env python # -*- coding:utf-8 -*- import tornado.ioloop import tornado.web import re class MainForm(object): def __init__(self): self.host = "(.*)" self.ip = "... 阅读全文
posted @ 2017-02-10 22:10 200ML 阅读(211) 评论(0) 推荐(0)
摘要:C:\Windows\System32\drivers\etc 阅读全文
posted @ 2017-02-08 21:34 200ML 阅读(142) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- coding:utf-8 -*- import tornado.ioloop import tornado.web container = {} class Session: def __init__(self,handler): self.handler = handler self.rando... 阅读全文
posted @ 2017-02-07 20:30 200ML 阅读(219) 评论(0) 推荐(0)
摘要:#####HTML login {{status}} ####代码 #!/usr/bin/env python # -*- coding:utf-8 -*- import tornado.ioloop import tornado.web container = {} class Sessi... 阅读全文
posted @ 2017-02-07 20:07 200ML 阅读(233) 评论(0) 推荐(0)
摘要:class Foo: def __init__(self): pass def __call__(self, *args, **kwargs): pass def __getitem__(self, item): print(item) pass def __setitem__(self, ke... 阅读全文
posted @ 2017-02-07 18:31 200ML 阅读(334) 评论(0) 推荐(0)
摘要:class MainHandler: def __init__(self): self.host = "(.*)" self.ip = "^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$" self.port 阅读全文
posted @ 2017-02-07 18:26 200ML 阅读(187) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- coding:utf-8 -*- import tornado.ioloop import tornado.web container = {} class Session: def __init__(self,handler): self.handler = handler # 生成随机字符串 ... 阅读全文
posted @ 2017-02-07 16:20 200ML 阅读(222) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- coding:utf-8 -*- import tornado.ioloop import tornado.web container = {} class IndexHandler(tornado.web.RequestHandler): def get(self, *args, **kwargs): if se... 阅读全文
posted @ 2017-02-07 15:28 200ML 阅读(147) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- coding:utf-8 -*- import tornado.ioloop import tornado.web class IndexHandler(tornado.web.RequestHandler): def get(self, *args, **kwargs): if self.get_argument... 阅读全文
posted @ 2017-02-07 14:26 200ML 阅读(1022) 评论(0) 推荐(0)
摘要:for循环 - 特殊语言 {% for item in obj%} {{ item }} {% end %} 普通传参- 模版语言 {{ nvp }} 执行函数 - 模版语言 {{ func(nvp) }} 执行类 - 模版语言 {% module custom() %} 继承母板 -模版语言 {% extends '../master/layout.html'%} 占位符,需要... 阅读全文
posted @ 2017-02-07 09:45 200ML 阅读(115) 评论(0) 推荐(0)
摘要:文件配置 settings = { # 模版路劲配置 'template_path':'tpl', # 静态路劲配置 如css 和 js 'static_path':'static', #静态文件的前缀 'static_url_prefix':'/ssss/', # 自定义函数配置 'ui_methods': md , # ... 阅读全文
posted @ 2017-02-06 09:29 200ML 阅读(277) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- coding:utf-8 -*- import tornado.ioloop import tornado.web INPUTS_LIST = [] class MainHandler(tornado.web.RequestHandler): def get(self): # self.write("Hello... 阅读全文
posted @ 2017-02-05 17:31 200ML 阅读(174) 评论(0) 推荐(0)
摘要:from wsgiref.simple_server import make_server def new(): return 'new' def RunServer(environ,start_response): start_response('200 OK',[('Conten-Type',' 阅读全文
posted @ 2017-02-05 14:53 200ML 阅读(181) 评论(0) 推荐(0)