Search code examples
pythonprintingwindow

How to close stdout/stderr window in python?


In my python app, I print some stuff during a cycle.

After the cycle, I want to close the stdout/stderr window that the prints produced using python code.


Solution

  • import sys
    
    sys.stdout.close()
    sys.stderr.close()
    

    Might be what you want. This will certainly close stdout/stderr at any rate.