返回顶部

收藏

验证身份证是否符合规则

更多
from urllib import urlencode
import urllib2
import json
url = 'http://api.uihoo.com/idcard/idcard.http.php'
def Bool_CheckID(ID):
    data = {}
    data['idnumber'] = ID
    data['format'] = 'json'
    IDdata = urlencode(data)
    response = urllib2.urlopen(url,IDdata)
    rsp = json.loads(response.read())
    if rsp['error'] == 0:
        return True
    else: 
        return False

标签:python

收藏

0人收藏

支持

0

反对

0

发表评论