No output when using PyCharm with sudo python script
I have the following problem:
I am using PyCharm 4.5.1 on raspberry Pi 2 with python 3.2.3 and I need to access files and modules that require root privileges.
To get root privileges I configured PyCharm to use this script as a python interpreter:
python-sudo.sh:
!#/bin/bash
sudo /usr/bin/python3 "$@"
This works but there is one problem. Any output (print, exceptions,...) produced by the program while it is running will not display in the PyCharm Run output window at the bottom.
Only after the program ends, all it's output will appear.
Does anyone have any idea how to fix this?
I am using PyCharm 4.5.1 on raspberry Pi 2 with python 3.2.3 and I need to access files and modules that require root privileges.
To get root privileges I configured PyCharm to use this script as a python interpreter:
python-sudo.sh:
!#/bin/bash
sudo /usr/bin/python3 "$@"
This works but there is one problem. Any output (print, exceptions,...) produced by the program while it is running will not display in the PyCharm Run output window at the bottom.
Only after the program ends, all it's output will appear.
Does anyone have any idea how to fix this?
Please sign in to leave a comment.
python-sudo.sh:
!#/bin/bash
sudo /usr/bin/python3 -u "$@"