#!/usr/bin/python
# -*- coding: utf-8 -*-
import feedparser, os, sys, webbrowser, errno

try: from Tkinter import * # python2
except: from tkinter import * # python3

try: import readline
except: import pyreadline as readline

#Path for saved RSS site feeds.
path = os.path.join(os.path.expanduser('~'), 'sites.txt')

urls = []
urlsFull = []

root = Tk()
root.wm_title("PyRSS")

try:
    # Open sites.txt
    file = open(path, 'r')
    # Go through each line in sites.txt
    for line in file:
        urlsFull.append(line)
        line = line.strip()
        if line not in urls:
            urls.append(line)
            # Feed line found in file to feedparser
            site = feedparser.parse(line)
            # Create labels for each site gotten out of the file
            website = Label(root, text=line)
            website.pack()
            # Top three entries from the RSS feed
            num = min(3, len(site['entries']))
            for entry in site['entries'][:num]:
                title = entry['title']
                callback = lambda link=entry['link']: openSite(link)
                buttonName = Button(root, text=title, command=callback)
                buttonName.pack(padx=30, pady=15)
            noMoreEntries = Label(root, text="No more entries!")
            noMoreEntries.pack(padx=5, pady=5)
    file.close()
    # Make button for adding RSS feeds to 
    addRSSButton = Button(root, text="+", command = lambda: create_window())
    addRSSButton.pack(side="right")

except (OSError, IOError) as e:
    # Confirm the error type
    if (errno.ENOENT == e.errno):
        # Tell the user the file was not found.
        print("No file found at: "+path)

def openSite(text): webbrowser.get().open(text)

# Create new window for adding new RSS feed to file.
def create_window():
    global feed
    feed = Toplevel()
    feed.wm_title("Add new RSS feed")

    newFeedButton = Button(feed, text="Add New Feed", command = lambda: addNewFeed())
    newFeedButton.pack(side="right")

    global newFeedGet
    newFeedGet = Entry(feed, width=50)
    newFeedGet.pack(side="left")

def addNewFeed():
    add = open(path, 'w')
    for i in range(0, len(urlsFull)):
        add.write(urlsFull[i])
    add.write("\n"+newFeedGet.get())
    feed.destroy()

mainloop()

@@ -321,24 +321,23 @@
 ls = %5B%5D%0A
-urlsFull
+buttons
  = %5B%5D%0A%0Ar
@@ -490,38 +490,8 @@
 le:%0A
-        urlsFull.append(line)%0A
     
@@ -804,16 +804,63 @@
 .pack()%0A
+            num = min(3, len(site%5B'entries'%5D))%0A
         
@@ -905,55 +905,8 @@
 eed%0A
-            num = min(3, len(site%5B'entries'%5D))%0A
     
@@ -1083,15 +1083,17 @@
 tton
-Name = 
+s.append(
 Butt
@@ -1130,16 +1130,17 @@
 allback)
+)
 %0A       
@@ -1158,12 +1158,13 @@
 tton
-Name
+s%5B-1%5D
 .pac
@@ -1183,16 +1183,79 @@
 ady=15)%0A
+            # When we're read all the entries, inform the user%0A
         
@@ -1459,35 +1459,33 @@
 ext=%22+%22, command
- = 
+=
 lambda: create_w
@@ -1707,17 +1707,19 @@
 nd at: %22
-+
+ + 
 path)%0A%0Ad
@@ -1978,19 +1978,17 @@
  command
- = 
+=
 lambda: 
@@ -2160,99 +2160,102 @@
     
-add = open(path, 'w')%0A    for i in range(0, len(urlsFull)):%0A        add.write(urlsFull%5Bi%5D)%0A
+# Open the file for appending and add the new line to it%0A    with open(path, 'a') as add:%0A    
     
@@ -2268,13 +2268,8 @@
 ite(
-%22%5Cn%22+
 newF
@@ -2280,22 +2280,33 @@
 et.get()
+ + %22%5Cn%22
 )%0A    
+    
 feed.des
@@ -2313,16 +2313,21 @@
 troy()%0A%0A
+root.
 mainloop

Simplify several places