MyBot.py 文件源码

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

项目:halite_bot 作者: ewirkerman 项目源码 文件源码
def main_loop():
    while True:
        profiling = True
        # profiling = False
        if not profiling:
            main()
        else:
            currpath = 'stats\mybot-currturn.stats'
            lastpath = 'stats\mybot-lastturn.stats'

            if os.path.exists(currpath):
                if os.path.exists(lastpath):
                    os.remove(lastpath)
                os.rename(currpath, lastpath)
            cProfile.run('main()', currpath)
            # if "pypy" not in sys.executable:
            # else:
                # with open(currpath, "w") as f:
                    # vmprof.enable(f.fileno(), period=0.00099, memory=False)
                    # main()
                    # vmprof.disable()

#cProfile.run('main_loop()', 'stats\mybot.stats')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号