I have known that with -u
, the stdout buffer of python will be disabled. It works in sublime and bash, but in pycharm, I set Run->Edit Configurations->Interpreter options->add -u
, it doesn't. My test code is as following:
# -*- encoding: utf-8 -*-
import sys
print "stdout1"
print >> sys.stderr, "stderr1"
print "stdout2"
print >> sys.stderr, "stderr2"
print "stdout3"
print >> sys.stderr, "stderr3"
Here is the result in "Run" window:
C:\Python27\python.exe -u "D:/Python Projects/compute - 2016.7.13/main.py"
stderr1
stderr2
stderr3
stdout1
stdout2
stdout3
Process finished with exit code 0
The results always change, it seems that '-u' doesn't work