anita.py 文件源码

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

项目:anita 作者: gson1703 项目源码 文件源码
def halt(self):
        self.login()
        self.child.send("halt\n")
        try:
            # Wait for text confirming the halt, or EOF
            self.child.expect("(The operating system has halted)|(entering state S5)", timeout = 60)
        except pexpect.EOF:
            # Didn't see the text but got an EOF; that's OK.
            print "EOF"
        except pexpect.TIMEOUT, e:
            # This is unexpected but mostly harmless
            print "timeout waiting for halt confirmation:", e

# Calling this directly is deprecated, use Anita.login()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号