摘要:
http://blog.csdn.net/zouxy09/article/details/8775518 阅读全文
摘要:
http://docs.python-guide.org/en/latest/scenarios/scrape/ 阅读全文
摘要:
http://blog.sina.com.cn/s/blog_5e16f1770100gyxn.html 阅读全文
摘要:
前提是先安装python2.7,设置环境变量。1.pip install pyzmq2.pip install jinja23.pip install tornado4.pip install ipython最后运行ipython notebook 阅读全文
摘要:
ipython nbconvert notebookname.ipynb --to latex --post pdf 阅读全文
摘要:
转自:http://bbs.chinaunix.net/thread-1689276-1-1.htmlfilter(str.isdigit, '123ab45') 阅读全文
摘要:
打开https://pip.pypa.io/en/latest/installing.html#python-os-support下载pip-get.py进入python,执行pip-get.py安装完pip。或者安装,setuptool工具。进入.python/scripts目录,执行setup_... 阅读全文
摘要:
http://blog.chinaunix.net/uid-26722078-id-3484197.html1.列表推导看几个例子,一切就明白了。 1 #!/usr/bin/python 2 numbers = range(10) 3 size = len(numbers) 4 evens = [] 5 i = 0 6 while i < size: 7 if i%2 == 0: 8 evens.append(i) 9 i += 110 print evens11 12 #!/usr/bin/python13 evens = [i for i in range... 阅读全文
摘要:
http://eagletff.blog.163.com/blog/static/116350928201266111125832/一般情况下,如果要对一个列表或者数组既要遍历索引又要遍历元素时,可以用enumerate比如:for index,value in enumerate(list):print index,value当然也可以for i in range(0,len(list)):print i,list[i]相比较而言,前者更简练另外一种使用情况,当要计算文件的行数的时候,可以这样写:lineNum = len(open(fileName,'r').readlin 阅读全文
摘要:
1 >>> help(set) 2 Help on class set in module __builtin__: 3 4 class set(object) 5 | set(iterable) --> set object 6 | 7 | Build an unordered collection of unique elements.#无序、独一无二的元素 8 | 9 | Methods defined here: 10 | 11 | __and__(...) 12 | x.__and__(y) x&y 13 | 14 | ... 阅读全文