flask_server.py 文件源码

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

项目:mindstorm_game 作者: Hackslashloot 项目源码 文件源码
def game():
        # Controller page
    time_full = time.perf_counter()
    player_ip = request.remote_addr
        # To redirect players who isent in the ip list and has thearfor ni team
    redirect_var = True
    for i in players:
        if player_ip == i.ip:
            print("OK")
            redirect_var = False
    if redirect_var:
        return redirect(url_for('index'))
    team_var = get_team(player_ip)
    direction_var = None
    if request.method == 'POST':
                # Adds a request to move the robot in the multithread queue
        q.put(request.form['submit'])
    print(time.perf_counter() - time_full)
    return render_template('game.html',team=team_var, direction=direction_var)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号