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