connect.py 文件源码

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

项目:AirMapSDK-Embedded 作者: airmap 项目源码 文件源码
def __init__(self):
        """Initialize connect find os set ssl context, get IP address

            :param None:
            :returns: None

        :todo: Add ifconfig command to try to get ip address
            """

        try:
            if self.os.name == 'nt':
                ssl.create_default_context()
            elif self.os.name == 'posix':
                ssl._create_default_https_context = ssl._create_unverified_context
            else:
                ssl._create_default_https_context = ssl._create_unverified_context

        except Exception,e:
            pass

        try:
            #print socket.gethostname()
            thisIP = "IP Address: " + socket.gethostbyname(socket.gethostname())
            #Globals.strPrint (self.thisGlobals, thisIP)

        except Exception,e:
            #Globals.strPrint (self.thisGlobals, "No IP Found...")
            pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号