AlexaService.py 文件源码

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

项目:RaspberryEcho 作者: ericpotvin 项目源码 文件源码
def connected():
        """ Check if can connect to the Amazon oAuth2
            :return boolean
        """
        print "Checking Internet Connection"
        try:
            requests.get(AlexaService.AMAZON_TOKEN_URL)
            print "Connection OK"
            return True
        except requests.exceptions.Timeout as exception:
            print "Error: Timeout / " + exception.message
        except requests.exceptions.TooManyRedirects as exception:
            print "Error: Invalid URL provided / " + exception.message
        except requests.RequestException as exception:
            print "Error: Connection Failed / " + exception.message
            return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号