摘要: #/usr/bin/env/ python# _*_ coding:utf-8 _*_# author:linqinglongfrom tests.conftest import connection '''show databases; 列出数据库所有的名create database 数据库名 阅读全文
posted @ 2017-02-16 20:20 struggle-fi 阅读(682) 评论(0) 推荐(0) 编辑
摘要: root@mysql ~]# vi checkmysql.sh #!/bin/sh #create by mingongge at 2016-11-11 port=`netstat -lnt|grep 3306|wc -l` if [ $port -ne 1 ];then echo "mysql i 阅读全文
posted @ 2017-01-18 10:11 struggle-fi 阅读(514) 评论(0) 推荐(0) 编辑
摘要: #/usr/bin/env/ python# _*_ coding:utf-8 _*_# author:linqinglong#创建静态方法的用处class MsSqlHelper: @staticmethod def add(select): pass @staticmethod def dele 阅读全文
posted @ 2017-01-12 19:23 struggle-fi 阅读(184) 评论(0) 推荐(0) 编辑
摘要: # _*_ coding:utf-8 _*_'''#装饰器decorator就是一个返回函数的高阶函数 def outer(fun): def wrapper(): print('call %s:()' %fun.__name__) fun() return wrapper#执行@outer相当于o 阅读全文
posted @ 2017-01-11 00:31 struggle-fi 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 文件层级结构如下: reflact backend account.py admin.py index.py index 里面需要用到account.py中的函数login(),反射代码如下: #等同于importdata = input('plase input ur url:')array = 阅读全文
posted @ 2017-01-10 19:30 struggle-fi 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 字符串是编程时涉及到的最多的一种数据结构,对字符串进行操作的需求几乎无处不在。比如判断一个字符串是否是合法的Email地址,虽然可以编程提取@前后的子串,再分别判断是否是单词和域名,但这样做不但麻烦,而且代码难以复用。 正则表达式是一种用来匹配字符串的强有力的武器。它的设计思想是用一种描述性的语言来 阅读全文
posted @ 2017-01-10 16:29 struggle-fi 阅读(208) 评论(0) 推荐(0) 编辑