python类exit()的实例源码

main.py 文件源码 项目:developmentBoard 作者: TPYBoard 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def myThread_A():
    print('?? thread A-')
    _thread.exit()
main.py 文件源码 项目:developmentBoard 作者: TPYBoard 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def myThread_B(time_):
    time.sleep(time_)
    print('?? thread B-')
    print('?? thread B- Sleep 5s')
    time.sleep(5)
    print('?? thread B-Wake up')
    _thread.exit()
main.py 文件源码 项目:developmentBoard 作者: TPYBoard 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def myThread_C(time_):
    time.sleep(time_)
    print('?? thread C-')
    _thread.exit()
main_lock.py 文件源码 项目:developmentBoard 作者: TPYBoard 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def myThread_A():
    print('?? thread A-')
    _thread.exit()
main_lock.py 文件源码 项目:developmentBoard 作者: TPYBoard 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def myThread_B(time_):
    time.sleep(time_)
    if lock.acquire():#????
        print('?? thread B-')
        print('?? thread B- Sleep 5s')
        time.sleep(5)
        print('?? thread B-Wake up')
        lock.release()#??? ????
    _thread.exit()
_dummy_thread.py 文件源码 项目:gardenbot 作者: GoestaO 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def start_new_thread(function, args, kwargs={}):
    """Dummy implementation of _thread.start_new_thread().

    Compatibility is maintained by making sure that ``args`` is a
    tuple and ``kwargs`` is a dictionary.  If an exception is raised
    and it is SystemExit (which can be done by _thread.exit()) it is
    caught and nothing is done; all other exceptions are printed out
    by using traceback.print_exc().

    If the executed function calls interrupt_main the KeyboardInterrupt will be
    raised when the function returns.

    """
    if type(args) != type(tuple()):
        raise TypeError("2nd arg must be a tuple")
    if type(kwargs) != type(dict()):
        raise TypeError("3rd arg must be a dict")
    global _main
    _main = False
    try:
        function(*args, **kwargs)
    except SystemExit:
        pass
    except:
        import traceback
        traceback.print_exc()
    _main = True
    global _interrupt
    if _interrupt:
        _interrupt = False
        raise KeyboardInterrupt
_dummy_thread.py 文件源码 项目:gardenbot 作者: GoestaO 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def exit():
    """Dummy implementation of _thread.exit()."""
    raise SystemExit
_dummy_thread.py 文件源码 项目:projeto 作者: BarmyPenguin 项目源码 文件源码 阅读 34 收藏 0 点赞 0 评论 0
def start_new_thread(function, args, kwargs={}):
    """Dummy implementation of _thread.start_new_thread().

    Compatibility is maintained by making sure that ``args`` is a
    tuple and ``kwargs`` is a dictionary.  If an exception is raised
    and it is SystemExit (which can be done by _thread.exit()) it is
    caught and nothing is done; all other exceptions are printed out
    by using traceback.print_exc().

    If the executed function calls interrupt_main the KeyboardInterrupt will be
    raised when the function returns.

    """
    if type(args) != type(tuple()):
        raise TypeError("2nd arg must be a tuple")
    if type(kwargs) != type(dict()):
        raise TypeError("3rd arg must be a dict")
    global _main
    _main = False
    try:
        function(*args, **kwargs)
    except SystemExit:
        pass
    except:
        import traceback
        traceback.print_exc()
    _main = True
    global _interrupt
    if _interrupt:
        _interrupt = False
        raise KeyboardInterrupt
_dummy_thread.py 文件源码 项目:projeto 作者: BarmyPenguin 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def exit():
    """Dummy implementation of _thread.exit()."""
    raise SystemExit
_dummy_thread.py 文件源码 项目:flask-zhenai-mongo-echarts 作者: Fretice 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def start_new_thread(function, args, kwargs={}):
    """Dummy implementation of _thread.start_new_thread().

    Compatibility is maintained by making sure that ``args`` is a
    tuple and ``kwargs`` is a dictionary.  If an exception is raised
    and it is SystemExit (which can be done by _thread.exit()) it is
    caught and nothing is done; all other exceptions are printed out
    by using traceback.print_exc().

    If the executed function calls interrupt_main the KeyboardInterrupt will be
    raised when the function returns.

    """
    if type(args) != type(tuple()):
        raise TypeError("2nd arg must be a tuple")
    if type(kwargs) != type(dict()):
        raise TypeError("3rd arg must be a dict")
    global _main
    _main = False
    try:
        function(*args, **kwargs)
    except SystemExit:
        pass
    except:
        import traceback
        traceback.print_exc()
    _main = True
    global _interrupt
    if _interrupt:
        _interrupt = False
        raise KeyboardInterrupt
_dummy_thread.py 文件源码 项目:flask-zhenai-mongo-echarts 作者: Fretice 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def exit():
    """Dummy implementation of _thread.exit()."""
    raise SystemExit
_dummy_thread.py 文件源码 项目:aweasome_learning 作者: Knight-ZXW 项目源码 文件源码 阅读 56 收藏 0 点赞 0 评论 0
def start_new_thread(function, args, kwargs={}):
    """Dummy implementation of _thread.start_new_thread().

    Compatibility is maintained by making sure that ``args`` is a
    tuple and ``kwargs`` is a dictionary.  If an exception is raised
    and it is SystemExit (which can be done by _thread.exit()) it is
    caught and nothing is done; all other exceptions are printed out
    by using traceback.print_exc().

    If the executed function calls interrupt_main the KeyboardInterrupt will be
    raised when the function returns.

    """
    if type(args) != type(tuple()):
        raise TypeError("2nd arg must be a tuple")
    if type(kwargs) != type(dict()):
        raise TypeError("3rd arg must be a dict")
    global _main
    _main = False
    try:
        function(*args, **kwargs)
    except SystemExit:
        pass
    except:
        import traceback
        traceback.print_exc()
    _main = True
    global _interrupt
    if _interrupt:
        _interrupt = False
        raise KeyboardInterrupt
_dummy_thread.py 文件源码 项目:aweasome_learning 作者: Knight-ZXW 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def exit():
    """Dummy implementation of _thread.exit()."""
    raise SystemExit
test_socket.py 文件源码 项目:kbe_server 作者: xiaohaoppy 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def clientTearDown(self):
        self.done.set()
        thread.exit()
_dummy_thread.py 文件源码 项目:kbe_server 作者: xiaohaoppy 项目源码 文件源码 阅读 47 收藏 0 点赞 0 评论 0
def start_new_thread(function, args, kwargs={}):
    """Dummy implementation of _thread.start_new_thread().

    Compatibility is maintained by making sure that ``args`` is a
    tuple and ``kwargs`` is a dictionary.  If an exception is raised
    and it is SystemExit (which can be done by _thread.exit()) it is
    caught and nothing is done; all other exceptions are printed out
    by using traceback.print_exc().

    If the executed function calls interrupt_main the KeyboardInterrupt will be
    raised when the function returns.

    """
    if type(args) != type(tuple()):
        raise TypeError("2nd arg must be a tuple")
    if type(kwargs) != type(dict()):
        raise TypeError("3rd arg must be a dict")
    global _main
    _main = False
    try:
        function(*args, **kwargs)
    except SystemExit:
        pass
    except:
        import traceback
        traceback.print_exc()
    _main = True
    global _interrupt
    if _interrupt:
        _interrupt = False
        raise KeyboardInterrupt
_dummy_thread.py 文件源码 项目:kbe_server 作者: xiaohaoppy 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def exit():
    """Dummy implementation of _thread.exit()."""
    raise SystemExit
_dummy_thread.py 文件源码 项目:blog_flask 作者: momantai 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def start_new_thread(function, args, kwargs={}):
    """Dummy implementation of _thread.start_new_thread().

    Compatibility is maintained by making sure that ``args`` is a
    tuple and ``kwargs`` is a dictionary.  If an exception is raised
    and it is SystemExit (which can be done by _thread.exit()) it is
    caught and nothing is done; all other exceptions are printed out
    by using traceback.print_exc().

    If the executed function calls interrupt_main the KeyboardInterrupt will be
    raised when the function returns.

    """
    if type(args) != type(tuple()):
        raise TypeError("2nd arg must be a tuple")
    if type(kwargs) != type(dict()):
        raise TypeError("3rd arg must be a dict")
    global _main
    _main = False
    try:
        function(*args, **kwargs)
    except SystemExit:
        pass
    except:
        import traceback
        traceback.print_exc()
    _main = True
    global _interrupt
    if _interrupt:
        _interrupt = False
        raise KeyboardInterrupt
_dummy_thread.py 文件源码 项目:blog_flask 作者: momantai 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def exit():
    """Dummy implementation of _thread.exit()."""
    raise SystemExit
_dummy_thread.py 文件源码 项目:MyFriend-Rob 作者: lcheniv 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def start_new_thread(function, args, kwargs={}):
    """Dummy implementation of _thread.start_new_thread().

    Compatibility is maintained by making sure that ``args`` is a
    tuple and ``kwargs`` is a dictionary.  If an exception is raised
    and it is SystemExit (which can be done by _thread.exit()) it is
    caught and nothing is done; all other exceptions are printed out
    by using traceback.print_exc().

    If the executed function calls interrupt_main the KeyboardInterrupt will be
    raised when the function returns.

    """
    if type(args) != type(tuple()):
        raise TypeError("2nd arg must be a tuple")
    if type(kwargs) != type(dict()):
        raise TypeError("3rd arg must be a dict")
    global _main
    _main = False
    try:
        function(*args, **kwargs)
    except SystemExit:
        pass
    except:
        import traceback
        traceback.print_exc()
    _main = True
    global _interrupt
    if _interrupt:
        _interrupt = False
        raise KeyboardInterrupt
_dummy_thread.py 文件源码 项目:MyFriend-Rob 作者: lcheniv 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def exit():
    """Dummy implementation of _thread.exit()."""
    raise SystemExit


问题


面经


文章

微信
公众号

扫码关注公众号