qq.py 文件源码

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

项目:CNKI-QQFriend 作者: hsluoyz 项目源码 文件源码
def do_close_session():
    hwnd = QQ_checkTargetWindow()
    if hwnd == 0:
        print "Window doesn't exist, no need to close session."
        return
    else:
        print "move the window to front."
        win32gui.SetForegroundWindow(hwnd)
        time.sleep(1.0)

    for try_time in range(0, 10, 1):
        print "try to close the current session, try_time = " + str(try_time)
        QQ_CloseWindow()
        time.sleep(1.0)
        if QQ_checkTargetWindow() != 0:
            QQ_CloseWindow()
            print "close fails, probably the file is still in transmission."
            time.sleep(5.0)
        else:
            print "session closed."
            return
    print "can't close the current session, abort."
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号