谷歌正式推出Python版Google API客户端库
谷歌的开发者团队今天在博客中宣布,Google API的Python客户端库已经脱离了测试阶段,已经正式发布。其中包含了: 1. google-api-python-client:用于访问Google API的核心Python库2. oauth2client:针对OAut...
移动新时代的Python框架——Kivy
I've spend the last few weeks looking for a good framework for mobile development. I've got an idea for a mobile application that I want to move on as quickly as possible. However, I wasn't thrill...
Python有什么缺点?
Python seems all the rage these days, and not undeservingly - for it is truly a language with which one almost enjoys being given a new problem to solve. But, as a wise man once said (calling him ...
Python Linux开发
If you’re a programmer and you use Linux but you haven’t yet entered the amazing world that is Python development, you’re really missing out on something special. For years, I dismissed Python ...
Pythy syntax for C++11
Project maintained by pfultz2Hosted on GitHub Pages — Theme by mattgrahamPythyHaving it all now: Pythy syntax for C++11.OverviewIn a blog post, David Abrahams discussed an improved function...
A python proxy in less than 100 lines of code
What is a tcp proxy?It's a intermediary server intended to act in name of a client, and sometimes to do something useful with the data before it reaches the original target. Let's see a picture:...
Python行为驱动的开发BDD
Behavior. Driven Development is an excellent process to follow in software development. With testing often a practice that is pushed aside to the last minute (or ignored, entirely), baking the pro...
RoR、PHP和Python的比较
It is always advised by the web development experts that whenever you are confused about selecting the right platform. for developing the website then in that situation you should consider a few f...
Six提供了Python 2和Python 3的兼容库
地址:http://packages.python.org/six/Six provides simple utilities for wrapping over differences between Python 2 and Python 3.Six can be downloaded on PyPi. Its bug tracker and code hosting is...
让Django支持多种数据库
In a recent Django class one of my students posed the problem she was learning Django to tackle - she would be responsible for writing a web-based administrative interface to a database whose stru...
Implementing a generator/yield in a Python C extension
In Python, a generator is a function that returns an iterator object. There are a couple of ways to do this, but the most elegant and common one is to use the yield statement.For example, here i...
Using sub-generators for lexical scanning in Python
A few days ago I watched a very interesting talk by Rob Pike about writing a non-trivial lexer in Go. Rob discussed how the traditional switch-based state machine approach is cumbersome to write, ...
Pyjs介绍
What is Pyjs?Pyjs is a Rich Internet Application (RIA) Development Platform. for both Web and Desktop. It contains a Python-to-JavaScript. compiler, an AJAX framework and a Widget Set API. Pyj...
Python输出日志
Python provides a very powerful logging library in its standard library. A lot of programmers use print statements for debugging (myself included), but you can also use logging to do this. It’s a...
File hash GET parameters for Django staticfiles
AboutA class for the static files app in Django that invalidates outdated browser cache.How to useYou add the lineCODE:STATICFILES_STORAGE = 'path.to.hashpathstaticfilesstorage.HashPathStaticFilesStor...
用Django和mod_wsgi设置SVN基本的授权认证
Consider this use case:You have Django web application up and running on Apache and ‘mod_wsgi’. You plan to host Subversion repository on the same server and want it to be accessible to your w...
Python实现K-means算法的颜色量化
The aim of color clustering is to produce a small set of representative colors that capture the color properties of an image. Using the small set of color found by the clustering, a quantization p...
Threads Versus Greenlets in Python Networking Library Gevent
In a previous post, I gave an introduction to gevent to show some of the benefits your application might get from using gevent greenlets instead of threads. Some people, however, took issue with m...
What else is there in Python?
[size=10.5pt]We all use the else keyword in Python,usually accompanying if statement:CODE:if x > 0: print 'positive' elif x < 0: print 'negative' else: &nbs...
用Python解析XML(3)
Let's take a couple minutes to go over this code. First off is a bunch fo imports. This just sets up our environment with the needed compents from Reportlab and lxml. I also import the decimal module ...