Skip to content

Instantly share code, notes, and snippets.

View junetech's full-sized avatar

Juntaek HONG junetech

  • Pohang, Korea
  • 00:23 (UTC +09:00)
View GitHub Profile
@junetech
junetech / gist:b6b374ce5ca20c34feb18ad58399d027
Last active June 13, 2023 02:43 — forked from djsmith42/gist:3956189
Console output suppressor for Python code
"""http://thesmithfam.org/blog/2012/10/25/temporarily-suppress-console-output-in-python/
https://stackoverflow.com/questions/36956083/how-can-the-terminal-output-of-executables-run-by-python-functions-be-silenced-i
"""
import os
import sys
from contextlib import contextmanager
@contextmanager
def suppress_stdout():