飞机场场长

本博客主要摘录python相关的知识,欢迎参阅。

导航

2012年7月27日 #

HTML ISO-8859-1 Reference

摘要: http://www.w3schools.com/tags/ref_entities.aspISO-8859-1ISO-8859-1 is the default character set in most browsers.The first 128 characters of ISO-8859-1 is the original ASCII character-set (the numbers from 0-9, the uppercase and lowercase English alphabet, and some special characters).The higher par 阅读全文

posted @ 2012-07-27 11:24 飞机场场长 阅读(243) 评论(0) 推荐(0)

Python chardet 字符编码判断

摘要: http://pnig0s1992.blog.51cto.com/393390/496208使 用 chardet 可以很方便的实现字符串/文件的编码检测。尤其是中文网页,有的页面使用GBK/GB2312,有的使用UTF8,如果你需要去爬一些页面,知道网页编码 很重要的,虽然HTML页面有charset标签,但是有些时候是不对的。那么chardet就能帮我们大忙了。chardet实例import urllibrawdata = urllib.urlopen('http://www.google.cn/').read()import chardetchardet.detect(r 阅读全文

posted @ 2012-07-27 11:19 飞机场场长 阅读(313) 评论(0) 推荐(0)

MYSQL删除表的记录后如何使ID从1开始

摘要: http://blog.sina.com.cn/s/blog_68431a3b0100y04v.html 方法1:truncate table 你的表名//这样不但将数据全部删除,而且重新定位自增的字段方法2:delete from 你的表名dbcc checkident(你的表名,reseed,0)//重新定位自增的字段,让它从1开始方法3:如果你要保存你的数据,介绍你第三种方法,by QINYI用phpmyadmin导出数据库,你在里面会有发现哦编辑sql文件,将其中的自增下一个id号改好,再导入。-------------------------truncate命令是会把自增的字段还原为 阅读全文

posted @ 2012-07-27 11:17 飞机场场长 阅读(288) 评论(0) 推荐(0)