if not que.empty(): data = que.get() while True: try: if not que.empty(): data = que.get() if display_info: rounds = data["Round"] bullets = data["Bullet Count"] player_move = data["Player Move"] opp_move = data["Opp Move"] key = cv2.waitKey(1) camera.show_camera(display_msg, msg, display_time, time, display_info, rounds, bullets, player_move, opp_move, stat_data) if data['status'] == "Waiting for Opponent": display_msg = True msg = "Waiting for Opponent" display_info = True thread1 = threading.Thread(target=client.get_data, args=(que,)) thread1.start() elif data['status'] == "Make Move": display_msg = True msg = "Make Your Move" display_time = True frame_count = 100 elif data['status'] == "Winner": display_msg = True msg = "Winner!"