title: while loop in Python to update in window
body: <p>I have created a script and it is meant to insert a variable into the insert field. 
  So far, I have been able to create the <code>while</code> loop which prints the variable, so i know its working.</p>
  
  <p>The frustrating part is that it doesn't bring up the window, it only prints the variable:</p>
  
  <pre><code>import time
  import subprocess
  from Tkinter import *
  import urllib2
  from ttk import *
  import Tkinter as tk
  
  root = Tk()
  
  a= 0
  while a&lt;1:
  
      print a
  
  
      class Application(Frame):
              """GUI to display results of 'equity get'"""
  
              def __init__(self, master):
                  """initialise the Frame"""
                  Frame.__init__(self,master)
                  self.grid()
                  self.create_widgets()
  
              def create_widgets(self):
                  """Create button, text and entry Widget"""
                  """what it is i.e. label"""
  
  
                  self.data = Label(self, text ="Data")
                  self.data1 = Entry(self, width = 10)
  
  
                  self.data.grid(column = 1, row = 1)
                  self.data1.grid(column = 2, row = 1)
                  self.data1.grid(column = 3, row = 1)            
                  self.data1.insert(0,a)
  
  app = Application(root)
  root.title("reload test")
  root.geometry("700x300")
  root.mainloop()
  </code></pre>
  
  <p>The version below opens the window but the loop only iterates once, when in reality, i want it to continue all day.</p>
  
  <pre><code>import time
  import subprocess
  from Tkinter import *
  import urllib2
  from ttk import *
  import Tkinter as tk
  
  root = Tk()
  
  a= 0
  while a&lt;1:
  
      print a
  
  
      class Application(Frame):
              """GUI to display results of 'equity get'"""
  
              def __init__(self, master):
                  """initialise the Frame"""
                  Frame.__init__(self,master)
                  self.grid()
                  self.create_widgets()
  
              def create_widgets(self):
                  """Create button, text and entry Widget"""
                  """what it is i.e. label"""
  
  
                  self.data = Label(self, text ="Data")
                  self.data1 = Entry(self, width = 10)
  
  
                  self.data.grid(column = 1, row = 1)
                  self.data1.grid(column = 2, row = 1)
                  self.data1.grid(column = 3, row = 1)            
                  self.data1.insert(0,a)
  
      app = Application(root)
      root.title("reload test")
      root.geometry("700x200")
      root.mainloop()
  </code></pre>
  
  <p>Thank you @guest for your refernce to using the <code>after</code>function, however, I am a little unsure of where it needs to go.</p>
  
  <p>@Wooble the variable <code>a</code> will be a webscrape and I want it to insert the live information into my insert field Therefore, it will run a loop and insert what it finds!</p>
  
  <p>Perhaps I am placing the <code>after</code> function in the incorrect place!</p>
  
  <pre><code>import time
  import subprocess
  from Tkinter import *
  import urllib2
  from ttk import *
  import Tkinter as tk
  
  root = Tk()
  
  a= 0
  while a&lt;1:
      url = "https://uk.finance.yahoo.com/q?s=ngq14.nym&amp;ql=1"
      request= urllib2.Request(url)
      handle = urllib2.urlopen(request)
      content = handle.read()
      splitted_page24 = content.split("&lt;span id=\"yfs_l10_ngq14.nym\"&gt;", 1);
      splitted_page24 = splitted_page24[1].split("&lt;/span&gt;", 1)
      print splitted_page24[0]
  
  
      class Application(Frame):
              """GUI to display results of 'equity get'"""
  
              def __init__(self, master):
                  """initialise the Frame"""
                  Frame.__init__(self,master)
                  self.grid()
                  self.create_widgets()
  
              def create_widgets(self):
                  """Create button, text and entry Widget"""
                  """what it is i.e. label"""
  
  
                  self.data = Label(self, text ="Data")
                  self.data1 = Entry(self, width = 10)
  
  
                  self.data.grid(column = 1, row = 1)
                  self.data1.grid(column = 2, row = 1)
                  self.data1.grid(column = 3, row = 1)            
                  self.data1.insert(0,splitted_page24[0])
  
      app = Application(root)
      root.title("reload test")
      root.geometry("700x300")
      root.mainloop()
      root.after(15)                    
  </code></pre>