server.py 文件源码

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

项目:time2go 作者: twitchyliquid64 项目源码 文件源码
def _restart_with_reloader(self):
      while True:
        args = [sys.executable] + sys.argv
        if sys.platform == "win32":
          args = ['"%s"' % arg for arg in args]
        new_environ = os.environ.copy()
        new_environ["RUN_MAIN"] = "true"
        exit_code = os.spawnve(os.P_WAIT, sys.executable, args, new_environ)
        if exit_code != 3:
        if exit_code != 0:
            yn = raw_input('Server terminated abnormally, restart? [Yn]')
            if not yn or yn.upper() == 'Y':
                continue
        return exit_code
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号