摘要: 使用创建函数__new__() 阅读全文
posted @ 2018-03-14 18:31 破晓e 阅读(89) 评论(0) 推荐(0) 编辑
摘要: ps -ef |grep python |awk '{print $2}'|xargs kill -9 阅读全文
posted @ 2018-03-12 11:37 破晓e 阅读(371) 评论(0) 推荐(0) 编辑
摘要: sched 模块 引用time类实现任务定时执行 任务参数书元组类型,必须加参数后边必须加,号 阅读全文
posted @ 2018-01-25 10:31 破晓e 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 偏函数是将创建函数时,将固定参数写死,以至于以后直接调用函数,不用填入默认参数。 用到的库 functools 新方法名称 = functools.partial(方法名称, 默认参数) # 为某个方法添加固定参数 阅读全文
posted @ 2017-11-20 00:00 破晓e 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 1、在setting中设置MySQL连接信息 HOST=''MYSQL_DBNAME='anttest'MYSQL_PASSWORD=''MYSQL_USER='root'2、在pipeline中添加mysql异步连接类 from twisted.enterprise import adbapi i 阅读全文
posted @ 2017-11-19 23:11 破晓e 阅读(557) 评论(0) 推荐(0) 编辑
摘要: 前提安装好python、setuptools。 1.安装Python 安装完了记得配置环境,将python目录和python目录下的Scripts目录添加到系统环境变量的Path里。在cmd中输入python如果出现版本信息说明配置完毕(如下面截图)。python下载网站,https://www.p 阅读全文
posted @ 2017-11-03 16:57 破晓e 阅读(133) 评论(0) 推荐(0) 编辑
摘要: import jieba text = '我来到北京清华大学' default_mode =jieba.cut(text) full_mode = jieba.cut(text,cut_all=True) search_mode = jieba.cut_for_search(text) print "精确模式:","/".join(default_mode) prin... 阅读全文
posted @ 2017-11-01 11:29 破晓e 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 查看编码 SHOW VARIABLES LIKE 'character_set_%'; 依次修改like出来的字段 例如 set character_set_results=utf8; 完了修改/etc/my.cof文件 添加以下内容 编辑 /etc/my.cnf, 在里面加入,已经有[XXX]的, 阅读全文
posted @ 2017-10-15 17:23 破晓e 阅读(159) 评论(0) 推荐(0) 编辑
摘要: grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option; flush privileges; 阅读全文
posted @ 2017-10-15 16:43 破晓e 阅读(157) 评论(0) 推荐(0) 编辑
摘要: ps -ef |grep xx 阅读全文
posted @ 2017-10-15 15:18 破晓e 阅读(215) 评论(0) 推荐(0) 编辑