会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
struggle-fi
博客园
首页
新随笔
联系
订阅
管理
2017年2月16日
python 链接数据库mysql.connector模块
摘要: #/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
阅读(708)
评论(0)
推荐(0)
2017年1月18日
监控mysql的端口脚本
摘要: 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
阅读(519)
评论(0)
推荐(0)
2017年1月12日
python 类里面的静态方法
摘要: #/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
阅读(189)
评论(0)
推荐(0)
2017年1月11日
python 装饰器
摘要: # _*_ 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
阅读(133)
评论(0)
推荐(0)
2017年1月10日
Day4 python反射
摘要: 文件层级结构如下: 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
阅读(121)
评论(0)
推荐(0)
python 正则表达式
摘要: 字符串是编程时涉及到的最多的一种数据结构,对字符串进行操作的需求几乎无处不在。比如判断一个字符串是否是合法的Email地址,虽然可以编程提取@前后的子串,再分别判断是否是单词和域名,但这样做不但麻烦,而且代码难以复用。 正则表达式是一种用来匹配字符串的强有力的武器。它的设计思想是用一种描述性的语言来
阅读全文
posted @ 2017-01-10 16:29 struggle-fi
阅读(208)
评论(0)
推荐(0)
公告