淘宝api上的python 文档主要是 针对 python 2.5。 python2.6有已经使用 hashlib 来替代 md5 以下就是 python2.6 使用 taobao api的实例

#!/usr/bin/env python

import urllib
import urllib2
import time
import hashlib

paramArray = {
    'app_key':'test',
    'method':'taobao.taobaoke.items.get',
    'format':'json',
    'v':'1.0',
    'timestamp':time.strftime('%Y-%m-%d %X', time.localtime()),
    'fields':'iid,title,nick,pic_url,price,click_url',
    'pid':'mm_5410_0_0',
    'cid':'1512',
    'page_no':'1',
    'page_size':'6'
}

def _sign(param,sercetCode):
    src = sercetCode + ''.join(["%s%s" % (k,v) for k, v in sorted(param.items())])
    return hashlib.new("md5",src).hexdigest().upper()
#    return md5

sign = _sign(paramArray,'test')

paramArray['sign'] = sign
form_data = urllib.urlencode(paramArray)
#print form_data

urlopen = urllib2.urlopen('http://gw.api.tbsandbox.com/router/rest', form_data)

#print urlopen.code

rsp = urlopen.read()
rsp = rsp.decode('UTF-8')

print rsp