From 430e286c56296c6201d15f5371546d58947b926f Mon Sep 17 00:00:00 2001 From: Gal Leibovich Date: Sun, 18 Nov 2018 18:02:55 +0200 Subject: [PATCH] muting pygame's hello message (#116) --- rl_coach/agents/human_agent.py | 4 +++- rl_coach/renderer.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rl_coach/agents/human_agent.py b/rl_coach/agents/human_agent.py index 2b92058..5d91ba1 100644 --- a/rl_coach/agents/human_agent.py +++ b/rl_coach/agents/human_agent.py @@ -18,7 +18,9 @@ import os from collections import OrderedDict from typing import Union -import pygame +import contextlib +with contextlib.redirect_stdout(None): + import pygame from pandas import to_pickle from rl_coach.agents.agent import Agent diff --git a/rl_coach/renderer.py b/rl_coach/renderer.py index 91a3c7a..03a13ff 100644 --- a/rl_coach/renderer.py +++ b/rl_coach/renderer.py @@ -15,7 +15,9 @@ # import numpy as np -import pygame +import contextlib +with contextlib.redirect_stdout(None): + import pygame from pygame.locals import HWSURFACE, DOUBLEBUF