"Run" runs the program, but without showing a terminal. This is mostly useful for GUI applications. "Run in Terminal" runs the program and shows its output in a terminal, but the terminal is closed upon completion of the program. You will not see the output as it is done so quick.
Four alternatives to test your Python console programs:
1. Open a terminal yourself, go to the directory where you have your Python file and run it with:
- Code: Select all
./test.py
The output will show, and the terminal remains open and waiting for your next command. BTW this works only if you have given the file execute permissions.
2. Make your program wait for a key press before closing, and then just use "Run in Terminal". For Python 3 you can do so by adding the line at the end:
- Code: Select all
input("Press Enter to continue...")
or for Python 2:
- Code: Select all
raw_input("Press Enter to continue...")
3. Change the configuration of your terminal to not close once the program that is running on it closes. To do so for GNOME Terminal, go to Edit > "Profile Preferences", "Title and Command" tab, and then change "When command exits" to "Hold the terminal open".
4. Use a IDE to write your Python applications, and those usually have the option to run programs from within the IDE and show terminal output.
I just use the first option
