I use a bash script to call several python scripts. I installed the bash plugin for PyCharm. I can run the script, but I don't see stdout during runtime, even though I see it after everything finished. How can I make that visible during runtime?
Asked
Active
Viewed 610 times
1
-
Can you share the script? – Reut Sharabani May 09 '15 at 12:32
1 Answers
1
Without all of the required information, my guess would be that this is due to Python buffering its output, which is its default behavior. You can easily disable this by passing python the -u
flag or by setting the PYTHONUNBUFFERED
environment variable.
This is described in this SO answer.
-
1Ok, that did it. Thanks! But why doesn't it happen when I run the same script in the shell? – Yanick Nedderhoff May 09 '15 at 12:58
-
Depending on what you mean by "running the script in the shell", its one of the following: 1) Python knows when it's in interactive mode, and disables output buffering in that case. 2) PyCharm probably knows to run Python without output buffering when one uses a Python run configuration. – taleinat May 09 '15 at 21:24