
python
文章平均质量分 57
kezhen
这个作者很懒,什么都没留下…
展开
-
windows Python3.5.4 环境安装sqlalchemy出现no attribute ‘sort‘
修改 文件c:\python35\lib\site-packages\pip\_vendor\pkg_resources\__init__.py。原创 2022-09-05 20:45:18 · 526 阅读 · 1 评论 -
Visualization: Mapping Global Earthquake Activity
http://introtopython.org/visualization_earthquakes.htmlThis project introduces the Basemap library, which can be used to create maps and plot geographical datasets.HomeContents转载 2015-03-06 08:00:19 · 1592 阅读 · 0 评论 -
Web Scraping With Scrapy and MongoDB
https://realpython.com/blog/python/web-scraping-with-scrapy-and-mongodb/In this article we’re going to build a scraper for an actual freelance gig where the client wants a Python program to scrape转载 2015-03-26 10:55:03 · 1475 阅读 · 0 评论 -
数据库乱码问题 & Python 编码问题(Unicode 的 encode、decode 相互转换 )
http://www.cnblogs.com/zhoujinyi/archive/2012/11/01/2748313.html前言: 今天有个项目需要合并(A合并到B),我所做的就是数据库的合并操作,其中出现的主要问题就是乱码的问题。乱码这个问题是很常见的问题,今天整理了下自己所理解的一点见解。案例: NAMECOMPANY转载 2015-03-03 14:11:47 · 1505 阅读 · 1 评论 -
python 编码转换
http://www.pythonclub.org/python-basic/codec主要介绍了python的编码机制,unicode, utf-8, utf-16, GBK, GB2312,ISO-8859-1 等编码之间的转换。常见的编码转换分为以下几种情况:自动识别 字符串编码可以使用 chardet 模块自动识别 字符创编码chardet 使用转载 2015-03-03 14:07:47 · 546 阅读 · 0 评论 -
Add, Remove, and Search Packages in Python with pip
http://www.pythoncentral.io/add-remove-and-search-packages-installed-with-pythons-pip/Using pip to Manage Python PackagesLike many useful programming ecosystems, Python provides a powerful and转载 2015-03-03 16:04:13 · 2109 阅读 · 0 评论 -
Database Programming in Python: Accessing MySQL
转自:http://www.devshed.com/c/a/python/database-programming-in-python-accessing-mysql/While data storage for applications is no longer considered complex, it is now simplified to the point that flex转载 2015-03-19 08:22:31 · 705 阅读 · 0 评论 -
read-python-code-with-cscope-on-emacs
https://github.com/PeerXu/blog/blob/master/_posts/2013-2-14-read-python-code-with-cscope-on-emacs.md本文是教你怎么使用 cscope+emacs来阅读 python代码, 网上已经有很多使用 cscope+emacs阅读 c/c++代码的教程. 但是没有找到python的, 故有了本文.转载 2015-02-23 20:47:18 · 1437 阅读 · 0 评论 -
使用scrapy进行大规模抓取
原文 http://blog.chedushi.com/archives/6488 使用scrapy有大概半年了,算是有些经验吧,在这里跟大家讨论一下使用scrapy作为爬虫进行大规模抓取可能遇到的问题。我们抓取的目标是教育网上的网站(目前主要针对.edu.cn和.cas.cn/.cass.cn域名),这半年里抓取了百万以上的url,其实百万url的规模不算大,我们一直在断断续续的修改,转载 2015-02-23 18:00:20 · 9842 阅读 · 0 评论 -
Practical Tips on Writing an Effective Web Crawler
http://rmmod.com/effective-web-crawler/A web crawler is a hard-working bot to gather information or index the pages on the Internet. It starts at some seeds URLs and finds every hyperlink on each转载 2015-03-27 21:41:38 · 1186 阅读 · 0 评论 -
Web Scraping
http://newcoder.io/scrape/Introduction to Web Scraping using Scrapy and PostgresPart 0: Setup – Initial setup of your scraper environment.Part 1: Scraper Setup – Building the scraper setup por转载 2015-03-27 21:53:04 · 870 阅读 · 0 评论 -
我看到的最棒的Twisted入门教程!
http://blog.sina.com.cn/s/blog_704b6af70100py9n.html学校一个项目中使用Twisted,学习过程中,看到Dave写的这个系列,使我耳目一新。看完一遍后,很想把这个系列和众多Python爱好者分享,于是将这个系列翻译出来的想法就冒出来了。时间紧张,能采用意译的就采用意译了,但尽量不影响理解就是了,如果有错误之处,请指正,防止更多的朋友产生错误转载 2015-03-30 11:20:24 · 622 阅读 · 0 评论 -
PYTHON-基础-时间日期处理小结
转自:http://www.wklken.me/posts/2015/03/03/python-base-datetime.htmlPython-基础-时间日期处理小结涉及对象1. datetime2. timestamp3. time tuple4. string5. datedatetime基本操作1. 获取当前datet转载 2016-05-16 15:02:35 · 528 阅读 · 0 评论 -
ConfigParser – Work with configuration files
引自:http://pymotw.com/2/ConfigParser/Use the ConfigParser module to manage user-editable configuration files for an application. The configuration files are organized into sections, and each se转载 2015-05-14 14:33:00 · 567 阅读 · 0 评论 -
Build a web app fast: Python, HTML & JavaScript resources
转自:http://www.pixelmonkey.org/2012/06/14/web-appWanna build a web app fast? Know a little bit about programming but want to build a modern web app using two well-supported, well-documented, and转载 2015-04-24 09:37:01 · 2402 阅读 · 0 评论 -
一行 Python 实现并行化 -- 日常多线程操作的新思路
转自:http://www.zhangzhibo.net/2014/02/01/parallelism-in-one-line/Python 在程序并行化方面多少有些声名狼藉。撇开技术上的问题,例如线程的实现和 GIL1,我觉得错误的教学指导才是主要问题。常见的经典 Python 多线程、多进程教程多显得偏“重”。而且往往隔靴搔痒,没有深入探讨日常工作中最有用的内容。传统的例子转载 2015-04-08 09:17:08 · 812 阅读 · 0 评论 -
Scrapy: Run Using TOR and Multiple Agents
http://pkmishra.github.io/blog/2013/03/18/how-to-run-scrapy-with-TOR-and-multiple-browser-agents-part-1-mac/Scrapy is a brilliant and well documented crawler written in python. Though it is not as转载 2015-04-08 16:24:36 · 1129 阅读 · 0 评论 -
Scrapy: Run Using TOR and Multiple Agents Part 2
http://pkmishra.github.io/blog/2013/04/16/scrapy-run-using-tor-and-multiple-agents-part-2-ubuntu/As discussed in last post this post is about running the same things on ubuntu. Again I am going转载 2015-04-08 16:27:39 · 1181 阅读 · 0 评论 -
80+ Best Free Python Tutorials, eBooks & PDF To Learn Programming Online
转自:http://www.fromdev.com/2014/03/python-tutorials-resources.html (网站上有很多不错的资源)Thinking of learning Python to make a dent in the universe? We have compiled a huge list of absolutely FREE Python tuto转载 2015-04-22 14:36:10 · 1656 阅读 · 0 评论 -
第四章 数据抓取与机器学习算法
http://inthecloud.readthedocs.org/zh_CN/latest/posts/ch04.html#scrapy-redis在开始这一章之前,你可能需要补习一下数学知识;还有熟悉下常见工具(语言),不必多年开发经验,会处理常见数据结构、能格式化文件即可。建议先通读一下 Scrapy 中文文档 ,这样你会省去好多Google的时间;在 知乎 上有许多关于 大数据转载 2015-03-30 11:17:33 · 1852 阅读 · 0 评论 -
Running Python Programs from Emacs
http://www.bnikolic.co.uk/blog/python-running-emacs.htmlTips on running python from Emacs.Setting-upPython interpreter to useIf you have more than one version of python installed on your转载 2015-01-22 21:36:41 · 1348 阅读 · 0 评论 -
Emacs as a Python IDE
http://www.jesshamrick.com/2012/09/18/emacs-as-a-python-ide/Update 04/08/2014: It seems like this post has been helpful for a lot of people, which really makes me happy! I just wanted to let转载 2015-01-22 10:41:24 · 2310 阅读 · 0 评论 -
踢开Eclisep&Aptana,Emacs变身强大IDE
http://cn-popeye.iteye.com/blog/1163548需要用的到的:emacs --宿主yasnippet --模板工具,灰常好用,输入class 按TAB,就会自动生成class的模板pymacs rope --rope开头的是非常棒的重构工具,比如rename,move,extract method等等。还有非常好转载 2015-01-29 15:00:03 · 2077 阅读 · 0 评论 -
python写入mysql时候 出现'latin-1' codec can't encode character 问题解决方法 以及python设置utf-8
http://www.cnblogs.com/C-paradox/p/3663997.html第一次用python写点东西,在捣鼓半天了解了下关于数据库操作,但是在写入数据库时出现'latin-1' codec can't encode character in position 1-4 异常看到latin-1,不负责猜想是关于编码的问题,于是想到python在刚试验时候关于utf-8转载 2015-01-27 21:20:56 · 2726 阅读 · 0 评论 -
python requests的安装与简单运用
转自:http://www.zhidaow.com/post/python-requests-install-and-brief-introduction强烈推荐!requests官方文档已有了中文版,请见http://cn.python-requests.org/en/latest/ 。requests是python的一个HTTP客户端库,跟urllib,urll转载 2015-01-08 16:33:20 · 1112 阅读 · 0 评论 -
python2.6(windows 7)下安装pycap、sendpkt、dpkt
转自:http://flyingzl.iteye.com/blog/600032转载 2014-07-12 10:53:36 · 2499 阅读 · 0 评论 -
Eric4在Windows下的安装
http://hi.baidu.com/runningon/item/1b07680e3453478a03ce1be4转载 2014-07-11 14:50:53 · 1493 阅读 · 0 评论 -
RedHat 安装pyopenssl总提示在安装cryptography-0.2.2依赖时出错
经google发现了:http://www.cnblogs.com/sharpstill/archive/2012/05/26/2519654.html这个帖子,其中提到了相同的问题,只需要easy_install http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.12.tar.gz 即可以完成一键安装原创 2014-03-21 15:46:38 · 4261 阅读 · 0 评论 -
在安装PyGTK时总是提示python: ImportError: No module named bz2
转自:http://www.zhetenga.com/view/python%3A%20ImportError%3A%20No%20module%20named%20bz2-ae70dd55.html在安装node.js时提示ImportError: No module named bz2。很明显这个python中没有装bz2的库导致的。解决方法:yum install bzi转载 2014-03-21 16:10:22 · 2377 阅读 · 0 评论 -
pygtk安装过程中出现configure.ac:80: error: possibly undefined macro: AC_MSG_ERROR
1、安装 pkg-config原创 2014-03-21 17:32:19 · 5102 阅读 · 0 评论 -
Emacs 设置 Python 编辑模式下的自动补全
http://blog.sina.com.cn/s/blog_632254bc01018ab7.html在网上找了很多Emacs下设置Python自动补全的资料,都不行,现在用以下的方式,居然成功了,感谢作者。。转自: http://hi.baidu.com/madrigar/item/d748bc0c33fc10103b53ee34 1. 安装 pymacs从 htt转载 2015-01-29 15:47:22 · 2452 阅读 · 0 评论 -
Configuring Emacs as a Python IDE
http://pedrokroger.net/configuring-emacs-python-ide/Emacs is a huge beast. It can read email, play tetris, act as a file manager,display google maps, and even edit videos. It has support for转载 2015-01-30 11:02:42 · 2191 阅读 · 0 评论 -
Python正则表达式指南
http://www.cnblogs.com/huxi/archive/2010/07/04/1771073.html1. 正则表达式基础1.1. 简单介绍正则表达式并不是Python的一部分。正则表达式是用于处理字符串的强大工具,拥有自己独特的语法以及一个独立的处理引擎,效率上可能不如str自带的方法,但功能十分强大。得益于这一点,在提供了正则表达式的语言里,正则表达式的语法转载 2015-02-02 17:16:48 · 1164 阅读 · 0 评论 -
python pytesseract 使用说明
1、安装pip install pytesseract2、使用#!/usr/bin/pythonimport Imageimport pytesseractimageObject=Image.open('test.jpg')print (imageObject)print (pytesseract.image_to_string(imageObject))#pr原创 2015-01-21 17:33:00 · 30544 阅读 · 1 评论 -
CentOS 6.4 安装搭建 Scrapy 0.22 环境
http://my.oschina.net/leezhen/blog/206966一、安装Python2.7.6更新CentOS lib库文件yum -y update安装开发工具包yum groupinstall -y development安装扩展包yum install -y zlib-dev openssl-devel转载 2015-02-10 11:42:27 · 1156 阅读 · 0 评论 -
Kali 安装Scrapy爬虫框架
当前Kali系统的python 版本为:root@TestBackTrack:~# python -VPython 2.7.31、安装pip没有默认的pip(Python version >=2.7.9后默认有pip),安装pip:root@TestBackTrack:~# sudo apt-get install python-pip........ro原创 2015-01-21 13:37:14 · 5629 阅读 · 0 评论 -
Emacs中打造强大的Python IDE
http://www.cnblogs.com/coderzh/archive/2009/12/26/emacspythonide.html本文将介绍,在Emacs中,通过各种扩展,打造强大的Python IDE环境,包括Snippet工具,智能提示,自动补全,重构工具,调试以及GAE的调试,等等。以下各工具的安装前提是你对Emacs的配置文件有一定的了解,所有相关的el文件都必须放在loa转载 2015-01-22 10:52:54 · 1124 阅读 · 0 评论 -
Emacs as a powerful Python IDE
http://www.enigmacurry.com/2008/05/09/emacs-as-a-powerful-python-ide/Last night at the Python user group I gave a short demo on using Emacs as a Python editor/IDE. My macbook pro refused to disp转载 2015-02-10 10:56:35 · 1073 阅读 · 0 评论 -
A Guide to Web Scraping Tools
http://www.garethjames.net/a-guide-to-web-scrapping-tools/Web Scrapers are tools designed to extract / gather data in a website via crawling engine usually made in Java, Python, Ruby and other p转载 2015-01-21 15:49:10 · 4338 阅读 · 0 评论 -
使用python的logging模块
http://bbs.chinaunix.net/thread-3590256-1-1.html一、从一个使用场景开始开发一个日志系统, 既要把日志输出到控制台, 还要写入日志文件Python代码import logging# 创建一个loggerlogger = logging.getLogger('mylogger')logg转载 2015-02-05 13:41:25 · 521 阅读 · 0 评论