You should open up a terminal window and run the program from the bash command line. If you try to run from the File Browser window, Ubuntu will open a terminal window just long enough to run the program, and then close the window. As you saw.
Navigate to the directory where you saved the file (your home folder, or perhaps a separate folder like pythonwork\ if you want to make one. Then run using the python command:
user@machine:~$ python myprogram.py
You can put in a prompt at the end, using raw_input for Python 2, or just plain input for Python 3, but that won't execute if your program dies from an uncaught exception. You really do want to see those error messages--especially when you are learning. Even so, you'll probably have to do two things to make the python source directly runnable.
1. Make the file executable. Either right-click on the icon in the File Browser and click Properties..., or run the bash command: chmod +x myprogram.py
2. Add a "shebang" line. Add the following as the very first line of your source:
#!/usr/bin/python
The "shebang" only works on Unix/Linux shells (like bash in Ubuntu.
If you have a GUI-based editor that you like, that's no problem. Just remember to save the changes to the file before you switch windows to run and test those changes.
If you like working in a windowed environment then, after you are comfortable with Python basics, take a look at tkinter, or one of the other GUI frameworks. There's a long list at:
http://wiki.python.org/moin/GuiProgramming