摘要: 记录文本:mediumtext型,create table article_abstract( article int, abstract mediumtext) 阅读全文
posted @ 2016-04-12 19:30 白天黑夜每日c 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 之前装过beautifulsoup,这次要装lxml,用easy_install装:到python/scripts目录下,运行easy_install lxml,自动安装 分界线 之前直接用urlopen(url),拒绝访问,403forbidden 模仿真实上网,添加cookie (转自http: 阅读全文
posted @ 2016-04-08 19:49 白天黑夜每日c 阅读(303) 评论(0) 推荐(0) 编辑
摘要: import mysql.connector 在命令行里运行python脚本,显示没有mysql.connector cnx = mysql.connector(user =' ', password=' ',host =' ', database =' ') cnx.close() cursor 阅读全文
posted @ 2016-04-05 15:27 白天黑夜每日c 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 以下:citeulike是数据库名,user_article是table名 create database citeulike; create table user_article(user varchar(32), article varchar(12), tag varchar(40)); lo 阅读全文
posted @ 2016-04-03 21:52 白天黑夜每日c 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 下载mysql,启动总是有问题,杯具发现还没有好 1. 更改"my.ini",服务器部分和客户端部分 参考 http://www.cnblogs.com/feichexia/archive/2012/11/27/mysqlconf.html [mysql] 补充port=3306, basedir, 阅读全文
posted @ 2016-04-03 16:02 白天黑夜每日c 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 1. python读取文件时的路径,明明是放在一个文件夹里,怎么不完整路径会错 2. file.write(str1+str2)用+拼接,不能用, 3. open()用法: 4. 在用r+模式读写文件时,写之前要file.seek(文件位置),不然无法写。 阅读全文
posted @ 2016-03-29 21:48 白天黑夜每日c 阅读(319) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write a function to determine if it is a power of three. 阅读全文
posted @ 2016-03-29 18:01 白天黑夜每日c 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write a function to determine if it is a power of two. 负数和0都不是power of 2. 阅读全文
posted @ 2016-03-29 17:55 白天黑夜每日c 阅读(106) 评论(0) 推荐(0) 编辑
摘要: .re:(网上摘) 阅读全文
posted @ 2016-03-26 20:30 白天黑夜每日c 阅读(144) 评论(0) 推荐(0) 编辑
摘要: random.sample(sequence, k),从指定序列中随机获取指定长度的片断。sample函数不会修改原有序列 numpy.nonzero() Return the indices of the elements that are non-zero. 阅读全文
posted @ 2016-03-24 19:37 白天黑夜每日c 阅读(261) 评论(0) 推荐(0) 编辑