testMSOfficeEvents.py 文件源码

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

项目:OSPTF 作者: xSploited 项目源码 文件源码
def _WaitForFinish(ob, timeout):
    end = time.time() + timeout
    while 1:
        if msvcrt.kbhit():
            msvcrt.getch()
            break
        pythoncom.PumpWaitingMessages()
        stopEvent.wait(.2)
        if stopEvent.isSet():
            stopEvent.clear()
            break
        try:
            if not ob.Visible:
                # Gone invisible - we need to pretend we timed
                # out, so the app is quit.
                return 0
        except pythoncom.com_error:
            # Excel is busy (eg, editing the cell) - ignore
            pass
        if time.time() > end:
            return 0
    return 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号