__init__.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:pyrecord 作者: Aakashdeveloper 项目源码 文件源码
def tuling(self, info, apiKey = None):
        tuling_server = "http://www.tuling123.com/openapi/api"

        assert isinstance(info, str), "Info must be a string"
        assert apiKey is None or isinstance(apiKey, str), "`apiKey` must be `None` or a string"
        #using Rain's defaul tuline's keys
        if apiKey is None: apiKey = "fd2a2710a7e01001f97dc3a663603fa1"

        mac_address = uuid.UUID(int=uuid.getnode()).hex[-12:]

        url = tuling_server + "?key=" +apiKey + "&info=" + info

        re = urlopen(url).read()
        re_dict = json.loads(re)
        answer = re_dict['text']

        return answer

    # nuance header
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号