该代码参考新浪python api,适用于各个开源api请求 复制代码 代码如下:# -*- coding: utf-8 -*-import collectionsimport gzipimport urllibimport urllib2from urlparse import urlparse try: from cStringIO import StringIOexcept ImportError: from StringIO import StringIO try: import jsonexcept ImportError: import simplejson