views:

42

answers:

2

Hello,

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.

How can I do that?

Thanks in advance

+2  A: 
import sys

sys.stdout.close()
sys.stderr.close()

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

jdizzle
it worked, thanks!
aF
A: 

If you mean the prompt window that opens when you run a Python script on MS Windows, try specifying the executable pythonw instead of python, on the first line of your script.

rbp