cameras.py 文件源码

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

项目:main 作者: templerobotics 项目源码 文件源码
def __init__(self, ipaddress, username = 'admin', password = ''):
        self.address = ipaddress
        self.username = username
        self.password = password

        pwd_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
        pwd_mgr.add_password(None, 'http://{}'.format(self.address), self.username, self.password)
        handler = urllib2.HTTPBasicAuthHandler(pwd_mgr)

        self.conn = urllib2.build_opener(handler)

        self._url_snapshot = 'http://{address}/snapshot.cgi'.format(address = self.address)
        self._url_command = 'http://{address}/decoder_control.cgi?username={username}&password={password}&command='.format(address = self.address, username = self.username, password = self.password) + '{command}'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号