1- 多行注释 ''' ''' 或 """ """'''this is the standard way to include a multiple-line comment in you code'''"""this is the standard way to include a multipl...
分类:
编程语言 时间:
2014-06-18 15:46:56
阅读次数:
264
1、生成动态链接库[root@typhoeus79 c]# more head.c #include #include typedef struct _point{ int x; int y;}Point;Point * InitPoint(int x,int y){ Point ...
分类:
编程语言 时间:
2014-06-18 15:45:00
阅读次数:
267
关键词: nutch今日来看看Nutch怎么Parse页面的:Nutch运用了两种Html parser东西(NekoHTML和TagSoup)来完成html的获取,这两种东西是可经过配置来选择的。当然你要自己完成Parser你还能够选择HTMLParser[根据visitor访问者形式一起也供给了...
分类:
其他好文 时间:
2014-06-18 15:28:46
阅读次数:
181
Python中使用MySQL的方法具体可见:http://www.w3cschool.cc/python/python-mysql.html需要注意的是编码问题:要在多个地方设置为UTF8,具体可见:http://drizzlewalk.blog.51cto.com/2203401/448874同时...
分类:
数据库 时间:
2014-06-18 15:02:28
阅读次数:
245
使用urllib2模块构造http post数据结构,提交有文件的表单(multipart/form-data),本示例提交的post表单带有两个参数及一张图片,代码如下:#buld post body data boundary = '----------%s' % hex(int(...
分类:
编程语言 时间:
2014-06-18 14:55:59
阅读次数:
283
argv是在脚本内部使用,旨在接受命令传参比如,一个脚本argv.py,代码里面有,sys.argv[1],,sys.argv[2],那么运行这个脚本时,必须在后面跟两个参数,用空格隔开,如:python argv.py hello world 示例如下:首先编辑脚本 argv.py#coding:...
分类:
其他好文 时间:
2014-06-18 14:35:13
阅读次数:
191
转载自:http://hi.baidu.com/????_xu/blog/item/5b9650c513bd3f049d163d8b.htmlpython的set和其他语言类似, 是一个 基本功能包括关系测试和消除重复元素. 集合对象还支持union(联合),intersection(交), dif...
分类:
编程语言 时间:
2014-06-18 14:30:05
阅读次数:
243
1、reportlab:由很多部分组成且允许用户使用多种方法创建输出,地址:下载ReportLabhttps://pypi.python.org/simple/reportlab/http://www.reportlab.com/software/opensource/rl-toolkit/down...
分类:
编程语言 时间:
2014-06-18 14:22:27
阅读次数:
313
二叉树的插入与删除,来自Mark Allen Weiss的《数据结构与算法分析》。# Definition for a binary tree nodeclass TreeNode: def __init__(self, x): self.val = x self...
分类:
编程语言 时间:
2014-06-17 14:25:01
阅读次数:
291
近来方案做个爬虫的小比如,后来想想干脆运用的全部一点,今后就作为是个工程笔记,忘掉的代码就可以再到这个工程里查查了。solr是个很不错的东西,直接用就OK。下一方案方案看看compass,是一个封装了LuceneAPI的一个结构,用起来有点类似Hibernate,值得学习一下~ 好了,先个我们共享一...
分类:
其他好文 时间:
2014-06-17 14:15:31
阅读次数:
193