If gedit is your editor of choose, when creating python scripts, below are some modification to the editor I found to be very helpful:
1. Run gedit.
2. Open Preferences from the edit menu and select the Editor tab.
3. Change Tab width: to 4.
4. Select (make sure a check mark is in) 'Instert spaces instead of tabs'.
5. Turn on "Automatic indentation" as well.
6. Open the View tab and tun on "Display line numbers".