rfkill.py 文件源码

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

项目:PyRIC 作者: wraith-wireless 项目源码 文件源码
def gettype(idx):
    """
     returns the type of the device
     :param idx: rfkill index
     :returns: the type of the device
    """
    fin = None
    try:
        fin = open(os.path.join(spath,"rfkill{0}".format(idx),'type'),'r')
        return fin.read().strip()
    except IOError:
        raise pyric.error(errno.ENODEV,"No device at {0}".format(idx))
    finally:
        if fin: fin.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号