#!/usr/bin/python # encoding:utf-8 import urllib2, json, urllib dict ={} dict['key'] = '您申请的key,在会员中心->我的数据->对应数据的下方'; dict['bankcard'] = '123456789'; dict['apiversion'] = '2.0.5'; url = "http://v.1dq.com/api/c43 + "?" + urllib.urlencode(dict) result = urllib2.urlopen(urllib2.Request(url)) jsonarr = json.loads(result.read()) # 输出错误码 print jsonarr["error_code"]